Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.47 KB

README.md

File metadata and controls

55 lines (38 loc) · 1.47 KB

envparse

GoDev Build Status Coverage Status Go Report Card

Envparse is library for parse ENV variables written in Go.

Taken from moby/docker Dockerfile parser.

See original moby parser.

Parses env variables in form of:

<key> <value>
<key>=<value> ...

See also original ENV documentation

Quick-start

package main

import (
  "bytes"
  "fmt"

  "github.com/go-x-pkg/envparse"
)

func main() {
  env, err := envparse.Parse("LD_LIBRARY_PATH=/usr/lib:/usr/nvidia/cuda/lib64 PATH=/usr/bin:/bin")

  fmt.Println(env, err)
}