Files
go-mc/authenticate/authenticate_test.go
2019-08-01 12:09:58 +08:00

33 lines
519 B
Go

package authenticate
import (
"encoding/json"
"fmt"
"testing"
)
func TestEncodingPayload(t *testing.T) {
j, err := json.Marshal(payload{
Agent: agent{
Name: "Minecraft",
Version: 1,
},
UserName: "mojang account name",
Password: "mojang account password",
ClientToken: "client identifier",
RequestUser: true,
})
if err != nil {
t.Fatal(err)
}
t.Log(string(j))
}
func ExampleAuthenticate() {
resp, err := Authenticate("", "")
if err != nil {
panic(err)
}
fmt.Println(resp)
}