diff options
author | WilczyĆskiT <102859171+WilczynskiT@users.noreply.github.com> | 2022-08-04 19:17:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 11:17:35 -0600 |
commit | 2642bd72b7ca35b8622824fdffced2aefe1aaf11 (patch) | |
tree | 3bc73bada610bfee6377eb58d89ca18b72236966 /modules.go | |
parent | 17ae5acaba536e98cfa86ddcd6967801f1fa1bbe (diff) |
Replace strings.Index usages with strings.Cut (#4930)
Diffstat (limited to 'modules.go')
-rw-r--r-- | modules.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -324,11 +324,11 @@ func ParseStructTag(tag string) (map[string]string, error) { if pair == "" { continue } - parts := strings.SplitN(pair, "=", 2) - if len(parts) != 2 { + before, after, isCut := strings.Cut(pair, "=") + if !isCut { return nil, fmt.Errorf("missing key in '%s' (pair %d)", pair, i) } - results[parts[0]] = parts[1] + results[before] = after } return results, nil } |