Build requirements

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:

The code generation process ends with a message indicating the packages required for your generated code.

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).

Copyright 2015-2024 the go-swagger maintainers. This documentation is under an Apache 2.0 license.

Site built with HUGO using hugo-book