Skip to content

Commit

Permalink
Merge pull request ogier#16 from eparis/merge
Browse files Browse the repository at this point in the history
Merge ogier/pflag and enable travis
  • Loading branch information
spf13 committed May 1, 2015
2 parents 32bfad6 + bae9b8d commit 8730624
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sudo: false

language: go

go:
- 1.3
- 1.4
- tip
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag)

## Description

pflag is a drop-in replacement for Go's flag package, implementing
Expand Down
10 changes: 5 additions & 5 deletions bool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package pflag_test
package pflag

import (
"bytes"
"fmt"
"strconv"
"testing"

. "github.com/spf13/pflag"
)

// This value can be a boolean ("true", "false") or "maybe"
Expand Down Expand Up @@ -156,8 +155,9 @@ func TestImplicitFalse(t *testing.T) {
func TestInvalidValue(t *testing.T) {
var tristate triStateValue
f := setUpFlagSet(&tristate)
args := []string{"--tristate=invalid"}
_, err := parseReturnStderr(t, f, args)
var buf bytes.Buffer
f.SetOutput(&buf)
err := f.Parse([]string{"--tristate=invalid"})
if err == nil {
t.Fatal("expected an error but did not get any, tristate has value", tristate)
}
Expand Down
4 changes: 1 addition & 3 deletions flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package pflag_test
package pflag

import (
"bytes"
Expand All @@ -14,8 +14,6 @@ import (
"strings"
"testing"
"time"

. "github.com/spf13/pflag"
)

var (
Expand Down

0 comments on commit 8730624

Please sign in to comment.