Repository: go-python/gpython
Pull request #18 (2018-08-30 13:27:05)

gpython: use peterh/liner@v1.1.0
This CL bumps `go.mod` to use peterh/liner@v1.1.0.

Also really test Go modules by enabling `GO111MODULE=on`, only for `master`.

codecov-io: # [Codecov](https://codecov.io/gh/go-python/gpython/pull/18?src=pr&el=h1) Report
> Merging [#18](https://codecov.io/gh/go-python/gpython/pull/18?src=pr&el=desc) into [master](https://codecov.io/gh/go-python/gpython/commit/c6c49d2ecba5358d7736368226b6a50eb5c8ad1f?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/go-python/gpython/pull/18/graphs/tree.svg?width=650&token=A9Adbwjxyw&height=150&src=pr)](https://codecov.io/gh/go-python/gpython/pull/18?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master      #18   +/-   ##
=======================================
  Coverage   64.52%   64.52%           
=======================================
  Files          55       55           
  Lines        9746     9746           
=======================================
  Hits         6289     6289           
  Misses       3010     3010           
  Partials      447      447
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/go-python/gpython/pull/18?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/go-python/gpython/pull/18?src=pr&el=footer). Last update [c6c49d2...93db19b](https://codecov.io/gh/go-python/gpython/pull/18?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

corona10: @sbinet Can you squash all your commits into the single commit?
corona10: @sbinet 
Is there any reason not to merge into one commit likewise

```
gpython: use peterh/liner@v1.1.0 and enable GO111MODULE for master
```

or is this something like a convetion for convential Golang project?
IMHO, It's too short diff for seperating into 2 commits

Patch:
diff --git a/.travis.yml b/.travis.yml
index 2393718..2330ea5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,6 +26,7 @@ matrix:
    - go: master
      env:
        - TAGS="-tags travis"
+       - GO111MODULE=on
 
 script:
  - go install -v $TAGS ./...
diff --git a/builtin/builtin.go b/builtin/builtin.go
index 4e9ca18..0ccb36a 100644
--- a/builtin/builtin.go
+++ b/builtin/builtin.go
@@ -237,7 +237,6 @@ If the iterable is empty, return True.
 
 func builtin_all(self, seq py.Object) (py.Object, error) {
 	iter, err := py.Iter(seq)
-	res := false
 	if err != nil {
 		return nil, err
 	}
@@ -249,14 +248,11 @@ func builtin_all(self, seq py.Object) (py.Object, error) {
 			}
 			return nil, err
 		}
-		if py.ObjectIsTrue(item) {
-			res = true
-		} else {
-			res = false
-			break
+		if !py.ObjectIsTrue(item) {
+			return py.False, nil
 		}
 	}
-	return py.NewBool(res), nil
+	return py.True, nil
 }
 
 const any_doc = `any(iterable) -> bool
@@ -266,7 +262,6 @@ If the iterable is empty, Py_RETURN_FALSE."`
 
 func builtin_any(self, seq py.Object) (py.Object, error) {
 	iter, err := py.Iter(seq)
-	res := false
 	if err != nil {
 		return nil, err
 	}
@@ -279,11 +274,10 @@ func builtin_any(self, seq py.Object) (py.Object, error) {
 			return nil, err
 		}
 		if py.ObjectIsTrue(item) {
-			res = true
-			break
+			return py.True, nil
 		}
 	}
-	return py.NewBool(res), nil
+	return py.False, nil
 }
 
 const round_doc = `round(number[, ndigits]) -> number
diff --git a/go.mod b/go.mod
index be65516..aed4efd 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,3 @@
 module github.com/go-python/gpython
 
-require (
-	github.com/mattn/go-runewidth v0.0.3 // indirect
-	github.com/peterh/liner v0.0.0-20180619022028-8c1271fcf47f
-)
+require github.com/peterh/liner v1.1.0
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..324d4e1
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,4 @@
+github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4=
+github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
+github.com/peterh/liner v1.1.0 h1:f+aAedNJA6uk7+6rXsYBnhdo4Xux7ESLe+kcuVUF5os=
+github.com/peterh/liner v1.1.0/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=


Test patch:
diff --git a/builtin/tests/builtin.py b/builtin/tests/builtin.py
index 995a652..07d1f08 100644
--- a/builtin/tests/builtin.py
+++ b/builtin/tests/builtin.py
@@ -11,7 +11,7 @@ doc="all"
 assert all((0,0,0)) == False
 assert all((1,1,0)) == False
 assert all(["hello", "world"]) == True
-assert all([]) == False
+assert all([]) == True
 
 doc="any"
 assert any((0,0,0)) == False