github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/fixtures/goparsing/petstore/petstore-fixture/main.go (about)

     1  // Copyright 2015 go-swagger maintainers
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //    http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package main
    16  
    17  import (
    18  	"log"
    19  
    20  	"github.com/go-swagger/go-swagger/fixtures/goparsing/petstore"
    21  	"github.com/go-swagger/go-swagger/fixtures/goparsing/petstore/rest"
    22  )
    23  
    24  var (
    25  	// Version is a compile time constant, injected at build time
    26  	Version string
    27  )
    28  
    29  // This is an application that doesn't actually do anything,
    30  // it's used for testing the scanner
    31  func main() {
    32  	// this has no real purpose besides making the import present in this main package.
    33  	// without this line the meta info for the swagger doc wouldn't be discovered
    34  	petstore.APIVersion = Version
    35  
    36  	// This servers na hypothetical API
    37  	if err := rest.ServeAPI(); err != nil {
    38  		log.Fatal(err)
    39  	}
    40  }