Skip to content

Remove flag.Parse() from avisession.go #2969

Open
@dvirgilad

Description

@dvirgilad

Is your feature request related to a problem? Please describe.

Recently my team has been working on a crossplane provider for AVI, which uses the go SDK (through the terraform AVI provider). We ran into an issue with our flag parser whenever a flag was passed. We were not using the default flag package.
We traced the issue back to this function:

func NewAviSession(host string, username string, options ...func(*AviSession) error) (*AviSession, error) {
if flag.Parsed() == false {
flag.Parse()
}

Describe the solution you'd like

For an SDK, I don't really understand why it should parse flags. Considering it cannot be built into an executable (AFAIK). Would like to hear others thoughts about this.
Cheers.

Describe alternatives you've considered

For the time being, my team has implemented a solution using the default flag package.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions