Skip to content

Commit

Permalink
scanner buf
Browse files Browse the repository at this point in the history
  • Loading branch information
erangaeb committed Feb 21, 2018
1 parent f3be90e commit fbaee38
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/senz.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ type Senz struct {
var senzies = map[string]*Senzie{}
var mongoStore = &MongoStore{}

// max capacity of buffer
const maxCapacity = 128*1024

func main() {
// first init key pair
setUpKeys()
Expand Down Expand Up @@ -88,6 +91,8 @@ func main() {

func reading(senzie *Senzie) {
scanner := bufio.NewScanner(senzie.conn)
buf := make([]byte, maxCapacity)
scanner.Buffer(buf, maxCapacity)
scanner.Split(scanSemiColon)

// read senz
Expand Down

0 comments on commit fbaee38

Please sign in to comment.