code: func encodeAuth(authConfig *types.AuthConfig) string {
  	if authConfig.Username == "" && authConfig.Password == "" {
  		return ""
  	}
  
  	authStr := authConfig.Username + ":" + authConfig.Password
  	msg := []byte(authStr)
  	encoded := make([]byte, base64.StdEncoding.EncodedLen(len(msg)))
  	base64.StdEncoding.Encode(encoded, msg)
  	return string(encoded)
  }
docs: // encodeAuth creates a base64 encoded string to containing authorization information