github.com/ipni/storetheindex@v0.8.30/version.go (about)

     1  package main
     2  
     3  import (
     4  	_ "embed"
     5  	"encoding/json"
     6  	"fmt"
     7  
     8  	"github.com/ipni/storetheindex/internal/revision"
     9  )
    10  
    11  var version string
    12  
    13  //go:embed version.json
    14  var versionJSON []byte
    15  
    16  func init() {
    17  	var verMap map[string]string
    18  	json.Unmarshal(versionJSON, &verMap)
    19  	version = fmt.Sprint(verMap["version"], "-", revision.Revision)
    20  }