Skip to content

Dealing with "redeclared" const/types #549

Closed

Description

@jamietanna

When using Bitly's API generation, i.e.:

oapi-codegen --package=main -include-tags='Bitlinks' -o ./bitly.gen.go [v4.json](https://dev.bitly.com/v4/v4.json)

We receive a number of redeclared consts/types:

./bitly.gen.go:110:2: Both redeclared in this block        ./bitly.gen.go:101:2: other declaration of Both
./bitly.gen.go:112:2: Off redeclared in this block        ./bitly.gen.go:103:2: other declaration of Off
./bitly.gen.go:114:2: On redeclared in this block        ./bitly.gen.go:105:2: other declaration of On
./bitly.gen.go:119:2: Both redeclared in this block        ./bitly.gen.go:101:2: other declaration of Both
./bitly.gen.go:121:2: Off redeclared in this block        ./bitly.gen.go:103:2: other declaration of Off
./bitly.gen.go:123:2: On redeclared in this block        ./bitly.gen.go:105:2: other declaration of On
./bitly.gen.go:128:2: Both redeclared in this block        ./bitly.gen.go:101:2: other declaration of Both
./bitly.gen.go:130:2: Off redeclared in this block        ./bitly.gen.go:103:2: other declaration of Off
./bitly.gen.go:132:2: On redeclared in this block        ./bitly.gen.go:105:2: other declaration of On
./bitly.gen.go:263:6: Clicks redeclared in this block        ./bitly.gen.go:144:2: other declaration of Clicks
./bitly.gen.go:263:6: too many errors

Activity

  1. ghost closed this as completedin a4e5ee1on May 17, 2022
  2. jamietanna commented on May 17, 2022

    @jamietanna
    MemberAuthor

    Thanks for the fix, that works very nicely ☺

  3. added a commit that references this issue on Jan 16, 2024
    8de4dd1
  4. added a commit that references this issue on Mar 5, 2024
    a4e5ee1
  5. added a commit that references this issue on May 31, 2024
    e91ee72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions