Skip to content

Commit 4d49859

Browse files
authored
set default limit (#16)
1 parent 8a14686 commit 4d49859

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/serializer/Serializer.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ import (
3030
"github.com/spatialcurrent/go-stringify/pkg/stringify"
3131
)
3232

33+
const (
34+
NoSkip = 0 // used as SkipLines parameter to indicate no skipping when reading
35+
NoLimit = -1 // used to indicate that there is no limit on reading or writing, depending on context.
36+
NoComment = "" // used to indicate that there is no comment prefix to consider.
37+
)
38+
3339
const (
3440
FormatBSON = "bson" // Binary JSON
3541
FormatCSV = "csv" // Comma-Separated Values
@@ -44,8 +50,6 @@ const (
4450
FormatTOML = "toml" // TOML
4551
FormatTSV = "tsv" // Tab-Separated Values
4652
FormatYAML = "yaml" // YAML
47-
48-
NoLimit = -1
4953
)
5054

5155
var (
@@ -137,7 +141,9 @@ type Serializer struct {
137141
// New returns a new serializer with the given format.
138142
func New(format string) *Serializer {
139143
return &Serializer{
140-
format: format,
144+
format: format,
145+
skipLines: NoSkip,
146+
limit: NoLimit,
141147
}
142148
}
143149

0 commit comments

Comments
 (0)