sflags icon indicating copy to clipboard operation
sflags copied to clipboard

Fix go module name

Open ixdy opened this issue 4 years ago • 5 comments

It looks like there was a typo in the go module name introduced in #19:

$ go get -u github.com/octago/sflags
go: github.com/octago/sflags upgrade => v0.3.0                                          
go get: github.com/octago/[email protected]: parsing go.mod:                                                                                                                        
        module declares its path as: github.com/sflags                                                                                                                          
                but was required as: github.com/octago/sflags     

Note that we'll need to tag a new version after merging this PR.

ixdy avatar Feb 12 '21 18:02 ixdy

@ixdy Thank you.

I need to check what needs to be fixed for Travis-CI tests.

m0sth8 avatar Feb 12 '21 18:02 m0sth8

I think something may have changed about formatting in go1.15. When I run the tests locally (against go1.15.8):

--- FAIL: TestDurationValue (0.00s)                                                                                                                                             
    --- FAIL: TestDurationValue/in:_3l (0.00s)                                                                                                                                  
        values_generated_test.go:8971:                                                                                                                                          
                Error Trace:    values_generated_test.go:8971                                                                                                                   
                Error:          Error message not equal:                                                                                                                        
                                expected: "time: unknown unit l in duration 3l"                                                                                                 
                                actual  : "time: unknown unit \"l\" in duration \"3l\""                                                                                         
                Test:           TestDurationValue/in:_3l                                                                                                                        
--- FAIL: TestDurationSliceValue (0.00s)                                                                                                                                        
    --- FAIL: TestDurationSliceValue/in:_[1s,3l] (0.00s)                                                                                                                        
        values_generated_test.go:9109:                                                                                                                                          
                Error Trace:    values_generated_test.go:9109                                                                                                                   
                Error:          Error message not equal:                                                                                                                        
                                expected: "time: unknown unit l in duration 3l"                                                                                                 
                                actual  : "time: unknown unit \"l\" in duration \"3l\""                                                                                         
                Test:           TestDurationSliceValue/in:_[1s,3l]                                                                                                              
--- FAIL: TestStringDurationMapValue (0.00s)                                           
    --- FAIL: TestStringDurationMapValue/in:_[3l] (0.00s)         
        values_generated_test.go:9145:                                                  
                Error Trace:    values_generated_test.go:9145  
                Error:          Error message not equal:                                
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestStringDurationMapValue/in:_[3l]            
--- FAIL: TestIntDurationMapValue (0.00s)                                               
    --- FAIL: TestIntDurationMapValue/in:_[3l] (0.00s)           
        values_generated_test.go:9186:                                                  
                Error Trace:    values_generated_test.go:9186   
                Error:          Error message not equal:                                
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestIntDurationMapValue/in:_[3l]
--- FAIL: TestInt8DurationMapValue (0.00s)
    --- FAIL: TestInt8DurationMapValue/in:_[3l] (0.00s)
        values_generated_test.go:9227: 
                Error Trace:    values_generated_test.go:9227
                Error:          Error message not equal:
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestInt8DurationMapValue/in:_[3l]
--- FAIL: TestInt16DurationMapValue (0.00s)
    --- FAIL: TestInt16DurationMapValue/in:_[3l] (0.00s)
        values_generated_test.go:9268: 
                Error Trace:    values_generated_test.go:9268
                Error:          Error message not equal:                                                                                                               [30/1887]
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestInt16DurationMapValue/in:_[3l]
--- FAIL: TestInt32DurationMapValue (0.00s)
    --- FAIL: TestInt32DurationMapValue/in:_[3l] (0.00s)
        values_generated_test.go:9309: 
                Error Trace:    values_generated_test.go:9309
                Error:          Error message not equal:
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestInt32DurationMapValue/in:_[3l]
--- FAIL: TestInt64DurationMapValue (0.00s)
    --- FAIL: TestInt64DurationMapValue/in:_[3l] (0.00s)
        values_generated_test.go:9350: 
                Error Trace:    values_generated_test.go:9350
                Error:          Error message not equal:
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestInt64DurationMapValue/in:_[3l]
--- FAIL: TestUintDurationMapValue (0.00s)
    --- FAIL: TestUintDurationMapValue/in:_[3l] (0.00s)
        values_generated_test.go:9391: 
                Error Trace:    values_generated_test.go:9391
                Error:          Error message not equal:
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestUintDurationMapValue/in:_[3l]
--- FAIL: TestUint8DurationMapValue (0.00s)
    --- FAIL: TestUint8DurationMapValue/in:_[3l] (0.00s)
        values_generated_test.go:9432: 
                Error Trace:    values_generated_test.go:9432
                Error:          Error message not equal:
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestUint8DurationMapValue/in:_[3l]
--- FAIL: TestUint16DurationMapValue (0.00s) 
    --- FAIL: TestUint16DurationMapValue/in:_[3l] (0.00s)
        values_generated_test.go:9473: 
                Error Trace:    values_generated_test.go:9473
                Error:          Error message not equal:
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestUint16DurationMapValue/in:_[3l]
--- FAIL: TestUint32DurationMapValue (0.00s) 
    --- FAIL: TestUint32DurationMapValue/in:_[3l] (0.00s)
        values_generated_test.go:9514: 
                Error Trace:    values_generated_test.go:9514
                Error:          Error message not equal:
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestUint32DurationMapValue/in:_[3l]
--- FAIL: TestUint64DurationMapValue (0.00s) 
    --- FAIL: TestUint64DurationMapValue/in:_[3l] (0.00s)
        values_generated_test.go:9555: 
                Error Trace:    values_generated_test.go:9555
                Error:          Error message not equal:
                                expected: "time: unknown unit l in duration 3l"
                                actual  : "time: unknown unit \"l\" in duration \"3l\""
                Test:           TestUint64DurationMapValue/in:_[3l]
FAIL
FAIL    github.com/octago/sflags        0.058s
?       github.com/octago/sflags/cmd/genvalues  [no test files]
?       github.com/octago/sflags/examples/anonymous     [no test files]
?       github.com/octago/sflags/examples/cobra [no test files]
?       github.com/octago/sflags/examples/flag  [no test files]
?       github.com/octago/sflags/examples/kingpin       [no test files]
?       github.com/octago/sflags/examples/pflag [no test files]
?       github.com/octago/sflags/examples/simple_flag   [no test files]
?       github.com/octago/sflags/examples/urfave_cli    [no test files]
?       github.com/octago/sflags/examples/validator     [no test files]
ok      github.com/octago/sflags/gen/gcli       (cached)
ok      github.com/octago/sflags/gen/gflag      (cached)
ok      github.com/octago/sflags/gen/gkingpin   (cached)
ok      github.com/octago/sflags/gen/gpflag     (cached)
ok      github.com/octago/sflags/validator/govalidator  (cached)
FAIL

whereas the tests all pass against go1.14.

ixdy avatar Feb 12 '21 19:02 ixdy

Yeah, https://github.com/golang/go/commit/201cb046b745f8bb00e3d382290190c74ba7b7e1 caused the new failures. Thinking about how to best fix this now...

ixdy avatar Feb 12 '21 19:02 ixdy

(one option would be to test only against go1.15+ and update the test cases, especially given that go1.14 is likely going to EOL soon, though I'm not sure if that's something you're comfortable with.)

ixdy avatar Feb 12 '21 19:02 ixdy

@ixdy sorry, I have some issues with internet because of the weather and snow. Hope I'll be able to take a closer look next week.

m0sth8 avatar Feb 20 '21 00:02 m0sth8