Skip to content

Commit

Permalink
Make StdPrint func
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Feb 9, 2021
1 parent d6d7411 commit 2bf5c82
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/gee/gee.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package gee

import (
"bufio"
"fmt"
"os"
"strconv"
// "sync"
// "sync"

model "github.com/hahwul/gee/pkg/model"
printing "github.com/hahwul/gee/pkg/printing"
Expand Down Expand Up @@ -47,11 +46,9 @@ func Gee(options model.Options) {
// Prefix and Suffix
line = options.Prefix + l + options.Suffix

if options.RemoveNewLine {
fmt.Print(line)
} else {
fmt.Println(line)
}
// Printing and Files writing
StdPrint(line, options)

if (stdLine > options.ChunkedLine) && (options.ChunkedLine != 0) {
ClosedFiles(files)
for _, filename := range options.Files {
Expand Down
16 changes: 16 additions & 0 deletions pkg/gee/print.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package gee

import (
"fmt"

model "github.com/hahwul/gee/pkg/model"
)

// StdPrint is printing stdout
func StdPrint(line string, options model.Options) {
if options.RemoveNewLine {
fmt.Print(line)
} else {
fmt.Println(line)
}
}

0 comments on commit 2bf5c82

Please sign in to comment.