Skip to content

Commit

Permalink
Remove useless type assertions and update golangci-lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
Ullaakut committed Jan 21, 2019
1 parent 29d0ce4 commit ce9a68c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 1m

tests: false

# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
Expand Down
7 changes: 1 addition & 6 deletions xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,21 +307,16 @@ func (t *Table) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
break
}

switch token.(type) {
switch element := token.(type) {
case xml.StartElement:
element := token.(xml.StartElement)

for _, attribute := range element.Attr {
if attribute.Name.Local == "key" {
currentKey = attribute.Value
break
}
}

case xml.CharData:
element := token.(xml.CharData)
currentValue = string(element)

case xml.EndElement:
// Insert the current key/value pair.
table[currentKey] = currentValue
Expand Down

0 comments on commit ce9a68c

Please sign in to comment.