Back to Go Swagger

Build requirements

docs/generate/requirements.md

0.33.22.3 KB
Original Source

Requirements to build generated code

First time with golang?

Golang is a powerful and enticing language, but it may sometimes confuse first time users.

Before engaging further with go-swagger, please take a while to get comfortable with golang basics and conventions. That will save yourself much time and frustration.

About dependencies

Before generating code, you should make sure your target is going to properly resolve dependencies.

NOTE: generation uses extensively the goimports tool and dependencies must be matched at code generation time.

If you have built go-swagger locally (e.g. from source), all dependencies are already installed.

The following required dependencies may be fetched by using go get:

{{< hint "info" >}} The code generation process ends with a message indicating the packages required for your generated code. {{< /hint >}}

What are the dependencies required by the generated server?

There are some additional packages required by the (default) generated server. This depends on your generation options, a command line flags handling package:

What are the dependencies required by the generated client?

Same as above.

What are the dependencies required by the generated models?

The generated models only depend on:

How about generating specs?

The code that is scanned for spec generation must resolve all its dependencies (i.e. must build).