Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Latest commit

 

History

History
22 lines (19 loc) · 594 Bytes

README.md

File metadata and controls

22 lines (19 loc) · 594 Bytes

confutils

This package provides a set of functions to work with config files

Provided functions

// Looks given text (given as slice of bytes) for %ENV(VARIABLE),
// where VARIABLE is any possible variable name.
// If environment variable `VARIABLE` exists, replaces the whole
// expression with the variable value (even if it's empty).
// If the environment variable does not exist, keeps the expression as is.
func SubstEnvVars(text []byte) []byte {
    // ...
}
// String version of SubstEnvVars()
func SubstStringEnvVars(text string) string {
    // ...
}