Rename cmd -> examples

This commit is contained in:
Tnze
2021-02-27 15:00:25 +08:00
parent 8e7ac43bf5
commit a7bf3b683f
12 changed files with 28 additions and 17 deletions

View File

@ -0,0 +1,26 @@
package main
import (
"flag"
"fmt"
"os"
"github.com/Tnze/go-mc/yggdrasil"
)
var user = flag.String("user", "", "Can be an email address or player name for unmigrated accounts")
var pswd = flag.String("password", "", "Your password")
func main() {
flag.Parse()
resp, err := yggdrasil.Authenticate(*user, *pswd)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
id, name := resp.SelectedProfile()
fmt.Println("user:", name)
fmt.Println("uuid:", id)
fmt.Println("astk:", resp.AccessToken())
}