Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LatestRelease ¶
LatestRelease returns the latest release name of owner/repository.
If response code is not 200, returns the status as error (eg.: "404 Not Found")
This function uses the following API endpoint:
https://api.github.com/repos/{{ .Owner }}/{{ .Repository }}/releases/latest
Example ¶
package main import ( "fmt" "os" "git.gorbe.io/go/github" ) func main() { release, err := github.LatestRelease("goreleaser", "goreleaser") if err != nil { fmt.Fprintf(os.Stderr, "Failed to get latest release: %s\n", err) os.Exit(1) } fmt.Printf("%s\n", release) }
Output: v2.7.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.