Skip to content

Commit b131e6b

Browse files
doc updates
1 parent 212b930 commit b131e6b

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

decoder.go

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ const (
3636
typeNetMask
3737
typeTextUnmarshaler
3838
)
39+
40+
// reset iota
3941
const (
4042
sNone special = iota
4143
sJSON

decoder_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ type tbConfig struct {
7676
NoTag string
7777
IgnoreMe string `decoder:"-"`
7878
ImSpecial string
79-
TestSpaceSepStr []string `decoder:",ssv"`
80-
TestCommaSepStr []*string `decoder:",csv"`
81-
TestSpaceSepInt []int `decoder:",ssv"`
82-
TestCommaSepInt []int `decoder:",csv"`
79+
TestSpaceSepStr []string `decoder:",ssv"`
80+
TestCommaSepStr *[]*string `decoder:",csv"`
81+
TestSpaceSepInt []int `decoder:",ssv"`
82+
TestCommaSepInt []int `decoder:",csv"`
8383
}
8484

8585
func makeServer(t *testing.T, cb testutil.ServerConfigCallback) *testutil.TestServer {
@@ -259,8 +259,8 @@ func (es *encoderTestSuite) TestUnmarshal() {
259259
es.Assert().Equal(tbc.L1.Level2.Int, int64(-4))
260260
es.Assert().Equal(tbc.L1.Level2.Level3.Uint, uint32(5))
261261
es.Assert().Equal(tbc.L1.Level2.Level3.Int, int32(-6))
262-
es.Assert().Equal(len(tbc.TestCommaSepStr), 3)
263-
es.Assert().Equal(*(tbc.TestCommaSepStr[0]), `three, with embedded comma "and quotes"`)
262+
es.Assert().Equal(len(*tbc.TestCommaSepStr), 3)
263+
es.Assert().Equal(*((*tbc.TestCommaSepStr)[0]), `three, with embedded comma "and quotes"`)
264264
es.Assert().Equal(len(tbc.TestSpaceSepStr), 3)
265265
es.Assert().Equal(len(tbc.TestSpaceSepInt), 3)
266266
es.Assert().Equal(len(tbc.TestCommaSepInt), 3)

doc.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
// net.IPMask
1818
//
1919
// struct - nested struct by default implies a consul folder with the same name.
20-
// if the tag modifier "isJSON" is encountered, then the value of in the KV
21-
// is unmarshaled as isJSON using isJSON.Unmarshal
20+
// if the tag modifier "json" is encountered, then the value of in the KV
21+
// is unmarshaled as json using json.Unmarshal
2222
//
2323
// slice - the type can be most of the supported types, except another slice.
2424
//
@@ -65,8 +65,8 @@
6565
// // are not allowed, i.e., [][]string.
6666
// FooField4 []string
6767
//
68-
// // this interprets the value of foofield5 as isJSON data and
69-
// // will send it to isJSON.Unmarshal from encoding/isJSON package.
68+
// // this interprets the value of foofield5 as json data and
69+
// // will send it to json.Unmarshal from encoding/json package.
7070
// FooField5 *SomeStruct `decoder:"foofield5,json"`
7171
//
7272
// // this expects there to be a consul folder foofield6 and that the

0 commit comments

Comments
 (0)