github.com/qjfoidnh/BaiduPCS-Go@v0.0.0-20231011165705-caa18a3765f3/pcsverbose/utils.go (about) 1 package pcsverbose 2 3 import ( 4 "fmt" 5 "github.com/qjfoidnh/BaiduPCS-Go/pcsutil/pcstime" 6 "io" 7 "io/ioutil" 8 ) 9 10 //PrintReader 输出Reader 11 func PrintReader(r io.Reader) { 12 b, _ := ioutil.ReadAll(r) 13 fmt.Printf("%s\n", b) 14 } 15 16 // PrintArgs 输出字符串数组 17 func PrintArgs(w io.Writer, args ...string) { 18 for k, arg := range args { 19 io.WriteString(w, fmt.Sprintf("args[%d] = `%s`, ", k, arg)) 20 } 21 w.Write([]byte{'\n'}) 22 } 23 24 func TimePrefix() string { 25 return "[" + pcstime.BeijingTimeOption("Refer") + "]" 26 }