Skip to content

Commit 6675e06

Browse files
committed
fix(pkg): address revive unexported-return in flags and wait
Signed-off-by: vky5 <vky05@proton.me>
1 parent a564924 commit 6675e06

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

pkg/flags/uint32.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ import (
1919
"strconv"
2020
)
2121

22-
type uint32Value uint32
22+
type Uint32Value uint32
2323

2424
// NewUint32Value creates an uint32 instance with the provided value.
25-
func NewUint32Value(v uint32) *uint32Value {
26-
val := new(uint32Value)
27-
*val = uint32Value(v)
25+
func NewUint32Value(v uint32) *Uint32Value {
26+
val := new(Uint32Value)
27+
*val = Uint32Value(v)
2828
return val
2929
}
3030

3131
// Set parses a command line uint32 value.
3232
// Implements "flag.Value" interface.
33-
func (i *uint32Value) Set(s string) error {
33+
func (i *Uint32Value) Set(s string) error {
3434
v, err := strconv.ParseUint(s, 0, 32)
35-
*i = uint32Value(v)
35+
*i = Uint32Value(v)
3636
return err
3737
}
3838

39-
func (i *uint32Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
39+
func (i *Uint32Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
4040

4141
// Uint32FromFlag return the uint32 value of a flag with the given name
4242
func Uint32FromFlag(fs *flag.FlagSet, name string) uint32 {
43-
val := *fs.Lookup(name).Value.(*uint32Value)
43+
val := *fs.Lookup(name).Value.(*Uint32Value)
4444
return uint32(val)
4545
}

pkg/flags/uint32_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestUint32Value(t *testing.T) {
5252
}
5353
for _, tc := range cases {
5454
t.Run(tc.name, func(t *testing.T) {
55-
var val uint32Value
55+
var val Uint32Value
5656
err := val.Set(tc.s)
5757

5858
if tc.expectError {

pkg/wait/wait_time.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ var closec chan struct{}
2929

3030
func init() { closec = make(chan struct{}); close(closec) }
3131

32-
type timeList struct {
32+
type TimeList struct {
3333
l sync.Mutex
3434
lastTriggerDeadline uint64
3535
m map[uint64]chan struct{}
3636
}
3737

38-
func NewTimeList() *timeList {
39-
return &timeList{m: make(map[uint64]chan struct{})}
38+
func NewTimeList() *TimeList {
39+
return &TimeList{m: make(map[uint64]chan struct{})}
4040
}
4141

42-
func (tl *timeList) Wait(deadline uint64) <-chan struct{} {
42+
func (tl *TimeList) Wait(deadline uint64) <-chan struct{} {
4343
tl.l.Lock()
4444
defer tl.l.Unlock()
4545
if tl.lastTriggerDeadline >= deadline {
@@ -53,7 +53,7 @@ func (tl *timeList) Wait(deadline uint64) <-chan struct{} {
5353
return ch
5454
}
5555

56-
func (tl *timeList) Trigger(deadline uint64) {
56+
func (tl *TimeList) Trigger(deadline uint64) {
5757
tl.l.Lock()
5858
defer tl.l.Unlock()
5959
tl.lastTriggerDeadline = deadline

0 commit comments

Comments
 (0)