github.com/hungdoo/bot@v0.0.0-20240325145135-dd1f386f7b81/src/packages/command/common/command_test.go (about) 1 package command 2 3 import ( 4 "encoding/json" 5 "testing" 6 "time" 7 ) 8 9 func TestCommand(t *testing.T) { 10 cmd := Command{ 11 Name: "a", 12 Type: ContractCall, 13 Data: []string{"1", "2"}, 14 IdleTime: time.Minute, 15 } 16 b, err := json.MarshalIndent(cmd, "", " ") 17 if err != nil { 18 t.Error(err) 19 } 20 t.Log(string(b)) 21 }