mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 22:22:52 +00:00
[Go] Add a generator for the gin framework (#1048)
* copy from go-server and add go-gin-server generator * change the templates for the gin * fix warnings of the golint tool * fix the path of script * add samples * delete unnecessary comments (#1048) * make the help message more appropriate (#1048) * fix the link address format (#1048) * minor improvement
This commit is contained in:
31
samples/server/petstore/go-gin-api-server/main.go
Normal file
31
samples/server/petstore/go-gin-api-server/main.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
// 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"
|
||||
//
|
||||
sw "./go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.Printf("Server started")
|
||||
|
||||
router := sw.NewRouter()
|
||||
|
||||
log.Fatal(router.Run(":8080"))
|
||||
}
|
||||
Reference in New Issue
Block a user