vscode settings

This commit is contained in:
Tnze
2019-08-09 15:00:13 +08:00
parent dac6580ff8
commit 48ed1cf234
2 changed files with 14 additions and 20 deletions

11
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"go.testFlags": [
"-v"
],
"go.toolsEnvVars": {
"GOPROXY": "https://goproxy.cn"
},
"go.useLanguageServer": true,
"go.formatTool": "gofmt",
"go.inferGopath": true,
}

View File

@ -1,32 +1,15 @@
package yggdrasil package yggdrasil
import ( import (
"encoding/json"
"fmt" "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() { func ExampleAuthenticate() {
resp, err := Authenticate("", "") resp, err := Authenticate("", "")
if err != nil { if err != nil {
panic(err) panic(err)
} }
fmt.Println(resp)
fmt.Println(resp.SelectedProfile())
fmt.Println(resp.AccessToken())
} }