Skip to content

Commit

Permalink
allow control tag 000
Browse files Browse the repository at this point in the history
  • Loading branch information
boutros committed Dec 4, 2019
1 parent b3ff4f8 commit 5d336ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions marc/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
type ControlTag int

const (
tagIllegalControlTag ControlTag = iota
Tag000 = iota
Tag001
Tag002
Tag003
Expand Down Expand Up @@ -1056,12 +1056,12 @@ func (c DataTag) String() string {
func controlTagFromString(s string) (ControlTag, error) {
i, err := strconv.Atoi(s)
if err != nil {
return tagIllegalControlTag, err
return Tag000, err
}
if i >= 1 && i <= 9 {
if i >= 0 && i <= 9 {
return ControlTag(i), nil
}
return tagIllegalControlTag, errors.New("not a control tag: " + s)
return Tag000, errors.New("not a control tag: " + s)
}

func dataTagFromString(s string) (DataTag, error) {
Expand Down

0 comments on commit 5d336ee

Please sign in to comment.