()
| 91 | } |
| 92 | |
| 93 | func (g GiteaToolsAssets) GetOS() (*string, error) { |
| 94 | if g.Name == "" { |
| 95 | return nil, fmt.Errorf("gitea tools name is empty") |
| 96 | } |
| 97 | |
| 98 | remainder, err := stripRunnerPrefix(g.Name) |
| 99 | if err != nil { |
| 100 | return nil, fmt.Errorf("could not parse asset name: %w", err) |
| 101 | } |
| 102 | |
| 103 | // remainder is "{version}-{os}-{arch}[.exe]" |
| 104 | parts := strings.SplitN(remainder, "-", 3) |
| 105 | if len(parts) != 3 { |
| 106 | return nil, fmt.Errorf("could not parse asset name") |
| 107 | } |
| 108 | |
| 109 | os := parts[1] |
| 110 | return &os, nil |
| 111 | } |
| 112 | |
| 113 | func (g GiteaToolsAssets) GetArch() (*string, error) { |
| 114 | if g.Name == "" { |
no test coverage detected