Skip to content

parser error for interface type  #47

Open
@dnj12345

Description

I have the following code

type BasicTypes interface {
  // array types supported by KeyInArray generic function. The byte type is covered by uint8
  int | int8 | int16 | int32 | int64 |                           //    <==================
  uint | uint8 | uint16 | uint32 | uint64 |
  float32 | float64 | string
}
func KeyInArray[K BasicTypes](key K, list []K) bool {
  for _, lval := range list {
    if lval == key {
      return true
    }
  }
  return false
}

I am getting the following error when I run gotags on my code:

parse error: ...14:6: expected ';', found '|' (and 2 more errors)

The referenced line is indicated above with <====. The code compiles fine and works fine. Only gotags is complaining. Could someone explain why this is happening. Thanks.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions