summaryrefslogtreecommitdiff
path: root/vendor/github.com/gocarina/gocsv/sample_structs_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gocarina/gocsv/sample_structs_test.go')
-rw-r--r--vendor/github.com/gocarina/gocsv/sample_structs_test.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/vendor/github.com/gocarina/gocsv/sample_structs_test.go b/vendor/github.com/gocarina/gocsv/sample_structs_test.go
new file mode 100644
index 0000000..f6d1427
--- /dev/null
+++ b/vendor/github.com/gocarina/gocsv/sample_structs_test.go
@@ -0,0 +1,43 @@
+package gocsv
+
+type Sample struct {
+ Foo string `csv:"foo"`
+ Bar int `csv:"BAR"`
+ Baz string `csv:"Baz"`
+ Frop float64 `csv:"Quux"`
+ Blah *int `csv:"Blah"`
+ SPtr *string `csv:"SPtr"`
+}
+
+type EmbedSample struct {
+ Qux string `csv:"first"`
+ Sample
+ Ignore string `csv:"-"`
+ Grault float64 `csv:"garply"`
+ Quux string `csv:"last"`
+}
+
+type SkipFieldSample struct {
+ EmbedSample
+ MoreIgnore string `csv:"-"`
+ Corge string `csv:"abc"`
+}
+
+// Testtype for unmarshal/marshal functions on renamed basic types
+type RenamedFloat64Unmarshaler float64
+type RenamedFloat64Default float64
+
+type RenamedSample struct {
+ RenamedFloatUnmarshaler RenamedFloat64Unmarshaler `csv:"foo"`
+ RenamedFloatDefault RenamedFloat64Default `csv:"bar"`
+}
+
+type MultiTagSample struct {
+ Foo string `csv:"Baz,foo"`
+ Bar int `csv:"BAR"`
+}
+
+type TagSeparatorSample struct {
+ Foo string `csv:"Baz|foo"`
+ Bar int `csv:"BAR"`
+}