code: func getDefaultEnvPath(uid string, loginDefsPath string) string {
  	envPath := defaultEnvPath
  	envSuPath := defaultEnvPath
  
  	// open file, if it doesn't exist return a default path and move on
  	f, err := os.Open(loginDefsPath)
  	if err != nil {
  		log.Infof("Unable to open %q: %v: returning default path: %q", loginDefsPath, err, defaultEnvPath)
  		return defaultEnvPath
  	}
  	defer f.Close()
  
  	// read path to login.defs file /etc/login.defs line by line:
  	scanner := bufio.NewScanner(f)
  	for scanner.Scan() {
  		line := strings.TrimSpace(scanner.Text())
  
  		// skip comments and empty lines:
  		if line == "" || line[0] == '#' {
  			continue
  		}
  
  		// look for a line that starts with ENV_SUPATH or ENV_PATH
  		fields := strings.Fields(line)
  		if len(fields) > 1 {
  			if fields[0] == "ENV_PATH" {
  				envPath = fields[1]
  			}
  			if fields[0] == "ENV_SUPATH" {
  				envSuPath = fields[1]
  			}
  		}
  	}
  
  	// if any error occurs while reading the file, return the default value
  	err = scanner.Err()
  	if err != nil {
  		log.Warnf("Unable to read %q: %v: returning default path: %q", loginDefsPath, err, defaultEnvPath)
  		return defaultEnvPath
  	}
  
  	// if requesting path for uid 0 and no ENV_SUPATH is given, fallback to
  	// ENV_PATH first, then the default path.
  	if uid == "0" {
  		if envSuPath == defaultEnvPath {
  			return envPath
  		}
  		return envSuPath
  	}
  	return envPath
  }
docs: // getDefaultEnvPath returns the default value of PATH environment variable for
  // new logins (prior to shell) based on login.defs. Returns a strings which
  // looks like "PATH=/usr/bin:/bin"