vscode settings
This commit is contained in:
11
.vscode/settings.json
vendored
Normal file
11
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"go.testFlags": [
|
||||
"-v"
|
||||
],
|
||||
"go.toolsEnvVars": {
|
||||
"GOPROXY": "https://goproxy.cn"
|
||||
},
|
||||
"go.useLanguageServer": true,
|
||||
"go.formatTool": "gofmt",
|
||||
"go.inferGopath": true,
|
||||
}
|
@ -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())
|
||||
}
|
||||
|
Reference in New Issue
Block a user