From 48ed1cf23427d564623caf4ae7bdd227ade42923 Mon Sep 17 00:00:00 2001 From: Tnze Date: Fri, 9 Aug 2019 15:00:13 +0800 Subject: [PATCH] vscode settings --- .vscode/settings.json | 11 +++++++++++ yggdrasil/authenticate_test.go | 23 +++-------------------- 2 files changed, 14 insertions(+), 20 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..caee8e7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "go.testFlags": [ + "-v" + ], + "go.toolsEnvVars": { + "GOPROXY": "https://goproxy.cn" + }, + "go.useLanguageServer": true, + "go.formatTool": "gofmt", + "go.inferGopath": true, +} \ No newline at end of file diff --git a/yggdrasil/authenticate_test.go b/yggdrasil/authenticate_test.go index c2e7445..cf8ec38 100644 --- a/yggdrasil/authenticate_test.go +++ b/yggdrasil/authenticate_test.go @@ -1,32 +1,15 @@ package yggdrasil import ( - "encoding/json" "fmt" - "testing" ) -func TestEncodingPayload(t *testing.T) { - j, err := json.Marshal(authPayload{ - Agent: agent{ - Name: "Minecraft", - Version: 1, - }, - UserName: "mojang account email or 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) + + fmt.Println(resp.SelectedProfile()) + fmt.Println(resp.AccessToken()) }