mirror of
https://github.com/miekg/dns.git
synced 2025-08-11 12:06:58 +02:00
Add a version.go that has the semver version of this libary; now at 1.0.0. Use a struct so external code can easily check the for the version without resulting to string parsing. Add String() function if you want to access the version string. Use simple Makefile.release to kick off a new release: % edit version.go % make -f Makefile.release will tag and push according to version, if version is 1.0.0 the tag in git will be v1.0.0
11 lines
180 B
Go
11 lines
180 B
Go
package dns
|
|
|
|
import "testing"
|
|
|
|
func TestVersion(t *testing.T) {
|
|
v := V{1, 0, 0}
|
|
if x := v.String(); x != "1.0.0" {
|
|
t.Fatalf("Failed to convert version %v, got: %s", v, x)
|
|
}
|
|
}
|