github.com/iikira/iikira-go-utils@v0.0.0-20230610031953-f2cb11cde33a/pcsverbose/utils.go (about)

     1  package pcsverbose
     2  
     3  import (
     4  	"fmt"
     5  	"github.com/iikira/iikira-go-utils/utils/csttime"
     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 "[" + csttime.BeijingTimeOption("Refer") + "]"
    26  }