@@ -13,59 +13,59 @@ func TestParseHelpers(t *testing.T) {
1313 t .Run ("ParseString" , func (t * testing.T ) {
1414 val , err := ParseString ("hello" )
1515 assert .NoError (t , err )
16- assert .True (t , val .Set )
16+ assert .True (t , val .Valid )
1717 assert .Equal (t , "hello" , val .Value )
1818 })
1919
2020 t .Run ("ParseInt" , func (t * testing.T ) {
2121 val , err := ParseInt ("42" )
2222 assert .NoError (t , err )
23- assert .True (t , val .Set )
23+ assert .True (t , val .Valid )
2424 assert .Equal (t , 42 , val .Value )
2525
2626 val , err = ParseInt ("notanint" )
2727 assert .Error (t , err )
28- assert .False (t , val .Set )
28+ assert .False (t , val .Valid )
2929 })
3030
3131 t .Run ("ParseFloat" , func (t * testing.T ) {
3232 val , err := ParseFloat ("3.14" )
3333 assert .NoError (t , err )
34- assert .True (t , val .Set )
34+ assert .True (t , val .Valid )
3535 assert .Equal (t , 3.14 , val .Value )
3636 })
3737
3838 t .Run ("ParseBool" , func (t * testing.T ) {
3939 val , err := ParseBool ("true" )
4040 assert .NoError (t , err )
41- assert .True (t , val .Set )
41+ assert .True (t , val .Valid )
4242 assert .True (t , val .Value )
4343
4444 val , err = ParseBool ("false" )
4545 assert .NoError (t , err )
46- assert .True (t , val .Set )
46+ assert .True (t , val .Valid )
4747 assert .False (t , val .Value )
4848
4949 val , err = ParseBool ("maybe" )
5050 assert .Error (t , err )
51- assert .False (t , val .Set )
51+ assert .False (t , val .Valid )
5252 })
5353
5454 t .Run ("ParseU16" , func (t * testing.T ) {
5555 val , err := ParseU16 ("65535" )
5656 assert .NoError (t , err )
57- assert .True (t , val .Set )
57+ assert .True (t , val .Valid )
5858 assert .Equal (t , uint16 (65535 ), val .Value )
5959
6060 val , err = ParseU16 ("70000" )
6161 assert .Error (t , err )
62- assert .False (t , val .Set )
62+ assert .False (t , val .Valid )
6363 })
6464
6565 t .Run ("ParseU64" , func (t * testing.T ) {
6666 val , err := ParseU64 ("1234567890" )
6767 assert .NoError (t , err )
68- assert .True (t , val .Set )
68+ assert .True (t , val .Valid )
6969 assert .Equal (t , uint64 (1234567890 ), val .Value )
7070 })
7171}
@@ -86,21 +86,21 @@ func TestParseQueryParam(t *testing.T) {
8686 query : url.Values {},
8787 key : "limit" ,
8888 parser : ParseInt ,
89- expect : Value [int ]{Set : false },
89+ expect : Value [int ]{Valid : false },
9090 },
9191 {
9292 name : "empty value" ,
9393 query : url.Values {"limit" : {"" }},
9494 key : "limit" ,
9595 parser : ParseInt ,
96- expect : Value [int ]{Set : true },
96+ expect : Value [int ]{Valid : true },
9797 },
9898 {
9999 name : "valid int" ,
100100 query : url.Values {"limit" : {"10" }},
101101 key : "limit" ,
102102 parser : ParseInt ,
103- expect : Value [int ]{Set : true , Value : 10 },
103+ expect : Value [int ]{Valid : true , Value : 10 },
104104 },
105105 {
106106 name : "invalid int" ,
0 commit comments