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
|
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())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user