MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / loadFromEnv

Function loadFromEnv

pkg/resourceloader/resourceloader.go:97–103  ·  view source on GitHub ↗

loadFromEnv loads the content of an environment variable and returns it as a byte slice.

(envVar string)

Source from the content-addressed store, hash-verified

95
96// loadFromEnv loads the content of an environment variable and returns it as a byte slice.
97func loadFromEnv(envVar string) ([]byte, error) {
98 value, found := os.LookupEnv(envVar)
99 if !found {
100 return nil, fmt.Errorf("loading URL: env var $%s not found", envVar)
101 }
102 return []byte(value), nil
103}
104
105// createTempFile creates a temporary file with the given filename and writes the given data to it.
106func createTempFile(filename string, rawData []byte) (string, error) {

Callers 1

loadResourceFromURLOrEnvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected