Skip to content
Snippets Groups Projects
  • Serge Bazanski's avatar
    78ca72e9
    Build using Bazel · 78ca72e9
    Serge Bazanski authored
    This change integrates the Bazel build system into bio-rd.
    
    We also add support for:
      - running go dep from vendored libraries
      - running goveralls from vendored libraries
      - running bazel-based coverage from travis
    78ca72e9
    History
    Build using Bazel
    Serge Bazanski authored
    This change integrates the Bazel build system into bio-rd.
    
    We also add support for:
      - running go dep from vendored libraries
      - running goveralls from vendored libraries
      - running bazel-based coverage from travis
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
version.go 1.06 KiB
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
	"flag"
	"runtime"

	"github.com/golang/dep"
)

var (
	version    = "devel"
	buildDate  string
	commitHash string
)

const versionHelp = `Show the dep version information`

func (cmd *versionCommand) Name() string { return "version" }
func (cmd *versionCommand) Args() string {
	return ""
}
func (cmd *versionCommand) ShortHelp() string { return versionHelp }
func (cmd *versionCommand) LongHelp() string  { return versionHelp }
func (cmd *versionCommand) Hidden() bool      { return false }

func (cmd *versionCommand) Register(fs *flag.FlagSet) {}

type versionCommand struct{}

func (cmd *versionCommand) Run(ctx *dep.Ctx, args []string) error {
	ctx.Out.Printf(`dep:
 version     : %s
 build date  : %s
 git hash    : %s
 go version  : %s
 go compiler : %s
 platform    : %s/%s
`, version, buildDate, commitHash,
		runtime.Version(), runtime.Compiler, runtime.GOOS, runtime.GOARCH)
	return nil
}