Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Latest commit

 

History

History
39 lines (27 loc) · 676 Bytes

README.md

File metadata and controls

39 lines (27 loc) · 676 Bytes

ghnc (GitHub Name Checker)

GoDoc

A GitHub username checking library for Go.

Installation

go get github.com/Andoryuuta/ghnc

Usage

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)
}