mirror of
https://github.com/rancher/os.git
synced 2025-09-02 07:15:41 +00:00
move dependencies to vendor
This commit is contained in:
24
vendor/github.com/docker/libcompose/lookup/simple_env.go
generated
vendored
Normal file
24
vendor/github.com/docker/libcompose/lookup/simple_env.go
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package lookup
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/docker/libcompose/project"
|
||||
)
|
||||
|
||||
// OsEnvLookup is a "bare" structure that implements the project.EnvironmentLookup interface
|
||||
type OsEnvLookup struct {
|
||||
}
|
||||
|
||||
// Lookup creates a string slice of string containing a "docker-friendly" environment string
|
||||
// in the form of 'key=value'. It gets environment values using os.Getenv.
|
||||
// If the os environment variable does not exists, the slice is empty. serviceName and config
|
||||
// are not used at all in this implementation.
|
||||
func (o *OsEnvLookup) Lookup(key, serviceName string, config *project.ServiceConfig) []string {
|
||||
ret := os.Getenv(key)
|
||||
if ret == "" {
|
||||
return []string{}
|
||||
}
|
||||
return []string{fmt.Sprintf("%s=%s", key, ret)}
|
||||
}
|
Reference in New Issue
Block a user