(ctx context.Context)
| 71 | } |
| 72 | |
| 73 | func getLatestRelease(ctx context.Context) (*Release, error) { |
| 74 | if LatestRelease != nil { |
| 75 | return LatestRelease, nil |
| 76 | } |
| 77 | |
| 78 | release, _, err := github.NewClient(nil).Repositories.GetLatestRelease(ctx, "anchordotdev", "cli") |
| 79 | if err != nil { |
| 80 | return nil, err |
| 81 | } |
| 82 | |
| 83 | LatestRelease = &Release{ |
| 84 | PublishedAt: release.PublishedAt, |
| 85 | TagName: release.TagName, |
| 86 | } |
| 87 | |
| 88 | return LatestRelease, nil |
| 89 | } |
| 90 | |
| 91 | func UserAgent() string { |
| 92 | return "Anchor CLI " + VersionString() |
no outgoing calls
no test coverage detected