helpers
(project string)
| 157 | // helpers |
| 158 | |
| 159 | func splitProject(project string) (owner, repo string, err error) { |
| 160 | parts := strings.SplitN(project, "/", 2) |
| 161 | if len(parts) != 2 || parts[0] == "" || parts[1] == "" { |
| 162 | return "", "", fmt.Errorf("project must be in owner/repo format, got %q", project) |
| 163 | } |
| 164 | return parts[0], parts[1], nil |
| 165 | } |
| 166 | |
| 167 | func resolveToken(envName string) (string, error) { |
| 168 | token := os.Getenv(envName) |
no outgoing calls
no test coverage detected