Skip to content

Commit

Permalink
✨ feat(stdio): add new util func for quick output to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Mar 16, 2023
1 parent 17aeb31 commit 4120075
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions stdio/stdio.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,22 @@ func NewScanner(in any) *bufio.Scanner {
}
}

// WriteByte to stdout
func WriteByte(b byte) {
_, _ = os.Stdout.Write([]byte{b})
}

// WriteBytes to stdout
func WriteBytes(bs []byte) {
_, _ = os.Stdout.Write(bs)
}

// WritelnBytes to stdout
func WritelnBytes(bs []byte) {
_, _ = os.Stdout.Write(bs)
_, _ = os.Stdout.Write([]byte("\n"))
}

// WriteString to stdout
func WriteString(s string) {
_, _ = os.Stdout.WriteString(s)
Expand Down

0 comments on commit 4120075

Please sign in to comment.