Add unconvert linter
This linter checks for unnecessary type convertions. Some convertions are whitelisted because their type is different on 32bit platforms Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
@@ -26,9 +26,9 @@ func (e *Envelope) Field(fieldpath []string) (string, bool) {
|
||||
switch fieldpath[0] {
|
||||
// unhandled: timestamp
|
||||
case "namespace":
|
||||
return string(e.Namespace), len(e.Namespace) > 0
|
||||
return e.Namespace, len(e.Namespace) > 0
|
||||
case "topic":
|
||||
return string(e.Topic), len(e.Topic) > 0
|
||||
return e.Topic, len(e.Topic) > 0
|
||||
case "event":
|
||||
decoded, err := typeurl.UnmarshalAny(e.Event)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user