Help us shape the future of Go! Take the 2026 Go Developer Survey

version

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2025 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package version provides version information for the Gorilla DataFrame library.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "dev"
	BuildDate = unknownValue
	GitCommit = unknownValue
	GitTag    = unknownValue
	GoVersion = runtime.Version()
)

Build-time variables set by ldflags. These global variables are required for build-time injection via ldflags. Refactoring these to non-global would break the Makefile's -ldflags -X functionality.

Functions

func IsPreRelease

func IsPreRelease() bool

IsPreRelease returns true if this is a pre-release version.

func IsRelease

func IsRelease() bool

IsRelease returns true if this is a release version (not dev).

func UserAgent

func UserAgent() string

UserAgent returns a user agent string for HTTP requests.

Types

type BuildInfo

type BuildInfo struct {
	Version   string    `json:"version"`
	BuildDate string    `json:"build_date"`
	GitCommit string    `json:"git_commit"`
	GitTag    string    `json:"git_tag"`
	GoVersion string    `json:"go_version"`
	BuildTime time.Time `json:"build_time"`
	Dirty     bool      `json:"dirty"`
	Main      Module    `json:"main"`
	Deps      []Module  `json:"deps"`
	Settings  []Setting `json:"settings"`
}

BuildInfo contains detailed build information.

func Info

func Info() BuildInfo

Info returns detailed build information.

func (BuildInfo) String

func (b BuildInfo) String() string

String returns a formatted version string.

type Module

type Module struct {
	Path    string `json:"path"`
	Version string `json:"version"`
	Sum     string `json:"sum"`
}

Module represents a Go module with version information.

type SemVer

type SemVer struct {
	Major      int
	Minor      int
	Patch      int
	PreRelease string
	Build      string
}

SemVer represents semantic version components.

func ParseSemVer

func ParseSemVer(version string) (*SemVer, error)

ParseSemVer parses a semantic version string using a simplified parser.

This implementation handles basic semantic version parsing for build information and version comparison. For production applications requiring strict SemVer compliance, consider using a dedicated library like github.com/Masterminds/semver.

Supported format: [v]MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD]

Examples:

  • "1.0.0" -> SemVer{Major: 1, Minor: 0, Patch: 0}
  • "v2.1.3-alpha.1" -> SemVer{Major: 2, Minor: 1, Patch: 3, PreRelease: "alpha.1"}
  • "1.0.0+build.1" -> SemVer{Major: 1, Minor: 0, Patch: 0, Build: "build.1"}

func (*SemVer) Compare

func (s *SemVer) Compare(other *SemVer) int

Compare compares two semantic versions Returns: -1 if s < other, 0 if s == other, 1 if s > other.

func (*SemVer) String

func (s *SemVer) String() string

String returns the semantic version as a string.

type Setting

type Setting struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Setting represents a build setting.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL