Align our custom templates with the one from upstream;
https://github.com/go-swagger/go-swagger/tree/v0.32.3/generator/templates
- Add "TODO" comments in places where we applied patches to make it
easier to compare with upstream, and to see where differences are
intentional.
- Update the server/operations.gotmpl template;
- Add the "generated" header in the right place, so that it's
recognized as generated file.
- Add back the upstream template code; instead of removing the
code, put a "if false" block around it; this allows comparing
our forked templates with upstream when updating the version
of go-swagger (to make sure we're not missing fixes).
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Replace the hand-rolled Network, Summary and Inspect struct types in
api/types/network with types generated from the Swagger definition.
Disable the generation of all unwanted marshalers and unmarshalers.
Signed-off-by: Cory Snider <csnider@mirantis.com>
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.
Remove these imports in preparation of migrating our code to become an
actual go module.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
As described in https://golang.org/s/generatedcode, Go has
a formalized format that should be used to indicate that a
file is generated.
Matching that format helps linters to skip generated files;
From https://golang.org/s/generatedcode (https://github.com/golang/go/issues/13560#issuecomment-288457920);
> Generated files are marked by a line of text that matches the regular expression, in Go syntax:
>
> ^// Code generated .* DO NOT EDIT\.$
>
> The `.*` means the tool can put whatever folderol it wants in there, but the comment
> must be a single line and must start with `Code generated` and end with `DO NOT EDIT.`,
> with a period.
>
> The text may appear anywhere in the file.
This patch updates the template used for our generated types
to match that format.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>