Skip to content

Automatically generates source code to retrieve the HEAD revision of the git repository.

License

Notifications You must be signed in to change notification settings

fkei/gen-gitrev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gen-gitrev

Automatically generates source code to retrieve the HEAD revision of the git repository.

Download

install

$ go get github.com/fkei/gen-gitrev

Use

$ gen-gitrev -out /tmp/hoge_gen.go -pkgname main
Output generate file: /tmp/hoge_gen.go
	pacakge name: main
	revision: aa41f29462e685ebb199a205d97f938bc3789489

$ cat /tmp/hoge_gen.go
package main

func GetRevision() (string){
	return "aa41f29462e685ebb199a205d97f938bc3789489"
}

Options

$ gen-gitrev -h

Usage of gen-gitrev:
   gen-gitrev [OPTIONS] ARGS...

Options  -out="/Users/fkei/repository/github/gen-gitrev/gitrev_gen.go": output file path
  -pkgname="main": package name
  

go generate

//go:generate gen-gitrev -pkgname gen -out ./gen/gitrev_gen.go

go1.4

build

$ make # => ./gen-gitrev

About

Automatically generates source code to retrieve the HEAD revision of the git repository.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published