lint fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-09-30 21:13:13 +03:00
parent 7b2e3cc8aa
commit 3247d144a8
14 changed files with 62 additions and 46 deletions

View File

@@ -48,7 +48,7 @@ func Verify(a auth.Auth) error {
}
// set the credentials and token in auth options
a.Init(
_ = a.Init(
auth.ClientToken(token),
auth.Credentials(accID, accSecret),
)
@@ -79,7 +79,7 @@ func Verify(a auth.Auth) error {
}
// set the token
a.Init(auth.ClientToken(tok))
_ = a.Init(auth.ClientToken(tok))
}
}()

View File

@@ -49,7 +49,7 @@ func (p *poolConn) Close() error {
return nil
}
func (p *poolConn) Id() string {
func (p *poolConn) ID() string {
return p.id
}

View File

@@ -21,7 +21,7 @@ type Pool interface {
// Conn conn pool interface
type Conn interface {
// unique id of connection
Id() string
ID() string
// time it was created
Created() time.Time
// embedded connection

View File

@@ -82,9 +82,9 @@ func getValueByName(v reflect.Value, key string) (reflect.Value, error) {
case reflect.Struct:
value = v.FieldByName(key)
case reflect.Map:
kValue := reflect.Indirect(reflect.New(v.Type().Key()))
kValue.SetString(key)
value = v.MapIndex(kValue)
kvalue := reflect.Indirect(reflect.New(v.Type().Key()))
kvalue.SetString(key)
value = v.MapIndex(kvalue)
}
if !value.IsValid() {

View File

@@ -28,8 +28,8 @@ type Stream struct {
Entries chan *Entry
// Stop channel
Stop chan bool
// Id of the stream
Id string
// ID of the stream
ID string
}
// Put adds a new value to ring buffer
@@ -53,7 +53,7 @@ func (b *Buffer) Put(v interface{}) {
for _, stream := range b.streams {
select {
case <-stream.Stop:
delete(b.streams, stream.Id)
delete(b.streams, stream.ID)
close(stream.Entries)
case stream.Entries <- entry:
}
@@ -116,7 +116,7 @@ func (b *Buffer) Stream() (<-chan *Entry, chan bool) {
stop := make(chan bool)
b.streams[id] = &Stream{
Id: id,
ID: id,
Entries: entries,
Stop: stop,
}