loadFromEnv loads the content of an environment variable and returns it as a byte slice.
(envVar string)
| 95 | |
| 96 | // loadFromEnv loads the content of an environment variable and returns it as a byte slice. |
| 97 | func 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. |
| 106 | func createTempFile(filename string, rawData []byte) (string, error) { |
no outgoing calls
no test coverage detected