(state githubConnectState)
| 1240 | } |
| 1241 | |
| 1242 | func (s *Server) githubAppInstallationURL(state githubConnectState) (string, error) { |
| 1243 | res := fmt.Sprintf("https://github.com/apps/%s/installations/new", s.opts.GithubAppName) |
| 1244 | if state.isEmpty() { |
| 1245 | return res, nil |
| 1246 | } |
| 1247 | |
| 1248 | stateJSON, err := json.Marshal(state) |
| 1249 | if err != nil { |
| 1250 | return res, fmt.Errorf("failed to marshal github app installation state: %w", err) |
| 1251 | } |
| 1252 | |
| 1253 | return urlutil.MustWithQuery(res, map[string]string{"state": string(stateJSON)}), nil |
| 1254 | } |
| 1255 | |
| 1256 | func fromStringPtr(s *string) string { |
| 1257 | if s == nil { |
no test coverage detected