forked from loafle/openapi-generator-original
add go.mod as supporting files to go-server (#4592)
This commit is contained in:
parent
eff94da9c9
commit
40799937fb
@ -165,6 +165,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
|
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
|
||||||
supportingFiles.add(new SupportingFile("main.mustache", "", "main.go"));
|
supportingFiles.add(new SupportingFile("main.mustache", "", "main.go"));
|
||||||
supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile"));
|
supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile"));
|
||||||
|
supportingFiles.add(new SupportingFile("go.mod.mustache", "", "go.mod"));
|
||||||
supportingFiles.add(new SupportingFile("routers.mustache", sourceFolder, "routers.go"));
|
supportingFiles.add(new SupportingFile("routers.mustache", sourceFolder, "routers.go"));
|
||||||
supportingFiles.add(new SupportingFile("logger.mustache", sourceFolder, "logger.go"));
|
supportingFiles.add(new SupportingFile("logger.mustache", sourceFolder, "logger.go"));
|
||||||
supportingFiles.add(new SupportingFile("api.mustache", sourceFolder, "api.go"));
|
supportingFiles.add(new SupportingFile("api.mustache", sourceFolder, "api.go"));
|
||||||
|
5
modules/openapi-generator/src/main/resources/go-server/go.mod.mustache
vendored
Normal file
5
modules/openapi-generator/src/main/resources/go-server/go.mod.mustache
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}
|
||||||
|
|
||||||
|
go 1.13
|
||||||
|
|
||||||
|
require github.com/gorilla/mux v1.7.3
|
@ -5,14 +5,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
// WARNING!
|
{{packageName}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/{{sourceFolder}}"
|
||||||
// Change this to a fully-qualified import path
|
|
||||||
// once you place this file into your project.
|
|
||||||
// For example,
|
|
||||||
//
|
|
||||||
// sw "github.com/myname/myrepo/{{sourceFolder}}"
|
|
||||||
//
|
|
||||||
{{packageName}} "./{{sourceFolder}}"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
5
samples/server/petstore/go-api-server/go.mod
Normal file
5
samples/server/petstore/go-api-server/go.mod
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
module github.com/GIT_USER_ID/GIT_REPO_ID
|
||||||
|
|
||||||
|
go 1.13
|
||||||
|
|
||||||
|
require github.com/gorilla/mux v1.7.3
|
@ -13,14 +13,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
// WARNING!
|
petstoreserver "github.com/GIT_USER_ID/GIT_REPO_ID/go"
|
||||||
// Change this to a fully-qualified import path
|
|
||||||
// once you place this file into your project.
|
|
||||||
// For example,
|
|
||||||
//
|
|
||||||
// sw "github.com/myname/myrepo/go"
|
|
||||||
//
|
|
||||||
petstoreserver "./go"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user