feat: docs api design

This commit is contained in:
neo-f
2023-03-22 22:45:17 +08:00
commit 084d0de8bc
52 changed files with 3420 additions and 0 deletions

26
pkg/utils/dbg.go Normal file
View File

@@ -0,0 +1,26 @@
package utils
import (
"encoding/json"
"fmt"
)
func DBG(v interface{}, msg ...string) {
bv, err := json.MarshalIndent(v, "", " ")
if len(msg) == 0 {
fmt.Println("===========DBG===========")
} else {
fmt.Printf("===========%s===========\n", msg[0])
}
if err != nil {
fmt.Println(err.Error())
} else {
fmt.Println(string(bv))
}
fmt.Println("=========================")
}
func DbgE(v interface{}, err error) {
bv, _ := json.Marshal(v)
fmt.Println(string(bv))
}