This commit is contained in:
JunDao
2019-05-01 15:22:42 +08:00
parent 2b58eb07b5
commit 0d436609ce
21 changed files with 91491 additions and 0 deletions

View File

@ -0,0 +1,32 @@
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)
}