A GitHub username checking library for Go.
go get github.com/Andoryuuta/ghnc
package main
import (
"fmt"
"github.com/Andoryuuta/ghnc"
)
func main() {
username := "Andoryuuta"
// Get the client
client, err := ghnc.GetGHClient()
if err != nil {
panic(err)
}
// Check if the username is available
available, reason, err := client.UsernameAvailable(username)
if err != nil {
panic(err)
}
fmt.Printf("Username %s available: %v (reason: %v)", username, available, reason)
}