fix: issues
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"backend/common/service/model"
|
||||
@@ -32,3 +33,33 @@ func Test_GenModel2(t *testing.T) {
|
||||
|
||||
t.Logf("%+v", oauthInfo)
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
ErrCode int `json:"errcode"`
|
||||
}
|
||||
|
||||
func (r *Response) Error() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type Access struct {
|
||||
Response
|
||||
AccessToken string `json:"access_token"`
|
||||
}
|
||||
|
||||
func Test_Data(t *testing.T) {
|
||||
data := &Access{
|
||||
Response: Response{
|
||||
ErrCode: 0,
|
||||
},
|
||||
AccessToken: "123",
|
||||
}
|
||||
b, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
data.Error()
|
||||
|
||||
t.Logf("%s", b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user