Skip to content

go-x-pkg/envparse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
}