add go.mod as supporting files to go-server (#4592)

This commit is contained in:
Jason Lee 2019-11-25 15:58:51 +08:00 committed by William Cheng
parent eff94da9c9
commit 40799937fb
5 changed files with 13 additions and 16 deletions

View File

@ -165,6 +165,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
supportingFiles.add(new SupportingFile("main.mustache", "", "main.go"));
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("logger.mustache", sourceFolder, "logger.go"));
supportingFiles.add(new SupportingFile("api.mustache", sourceFolder, "api.go"));

View File

@ -0,0 +1,5 @@
module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}
go 1.13
require github.com/gorilla/mux v1.7.3

View File

@ -5,14 +5,7 @@ import (
"log"
"net/http"
// WARNING!
// 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}}"
{{packageName}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/{{sourceFolder}}"
)
func main() {

View 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

View File

@ -13,14 +13,7 @@ import (
"log"
"net/http"
// WARNING!
// 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"
petstoreserver "github.com/GIT_USER_ID/GIT_REPO_ID/go"
)
func main() {