code: func Subst(path string) string {
  	const (
  		sepPrefix = "${"
  		sepSuffix = "}"
  	)
  
  	splits := strings.Split(path, sepPrefix)
  
  	var buffer bytes.Buffer
  
  	// first split precedes the first sepPrefix so should always be written
  	buffer.WriteString(splits[0]) // nolint: gas
  
  	for _, s := range splits[1:] {
  		subst, rest := substVar(s, sepPrefix, sepSuffix)
  		buffer.WriteString(subst) // nolint: gas
  		buffer.WriteString(rest)  // nolint: gas
  	}
  
  	return buffer.String()
  }
docs: // Subst replaces instances of '${VARNAME}' (eg ${GOPATH}) with the variable.
  // Variables names that are not set by the SDK are replaced with the environment variable.