Skip to content

Commit

Permalink
Bump the version to a string
Browse files Browse the repository at this point in the history
Previously we'd bump to a float, which is incorrect, and couldn't be parsed
when we attempted to bump the version again.
  • Loading branch information
Kevin Burke committed May 30, 2016
1 parent 262884d commit 2dc60a7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Makefile
@@ -0,0 +1,10 @@
.PHONY: test

install:
go install ./...

test:
go test -race ./... -timeout 1s

release: install test
bump_version minor main.go
2 changes: 1 addition & 1 deletion lib/lib.go
Expand Up @@ -157,7 +157,7 @@ func BumpInFile(vtype VersionType, filename string) (*Version, error) {
if err != nil {
return nil, err
}
value.Value = version.String()
value.Value = fmt.Sprintf("\"%s\"", version.String())
f, err := os.Create(filename)
if err != nil {
return nil, err
Expand Down
13 changes: 13 additions & 0 deletions main_test.go
@@ -0,0 +1,13 @@
package main

import (
"reflect"
"testing"
)

func TestVersionString(t *testing.T) {
typ := reflect.TypeOf(VERSION)
if typ.String() != "string" {
t.Errorf("expected VERSION to be a string, got %#v (type %#v)", VERSION, typ.String())
}
}

0 comments on commit 2dc60a7

Please sign in to comment.