3 Commits aecd3e20a7 ... 603b983277

Author SHA1 Message Date
  Adam 603b983277 Merge branch 'v1.1.2' into develop 3 years ago
  Adam 9918258662 update changelog 3 years ago
  Adam 6361833422 pass unwrapped slice to Recover function 3 years ago
3 changed files with 10 additions and 2 deletions
  1. 8 0
      CHANGELOG.rst
  2. 1 1
      gott.go
  3. 1 1
      gott_test.go

+ 8 - 0
CHANGELOG.rst

@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
 
 The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_`, using ReStructuredText instead of Markdown, and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
 
+[1.1.2] - 2020-04-24
+====================
+
+Fixed
+-----
+
+* pass unwrapped slice to Recover function
+
 [1.1.1] - 2020-04-22
 ====================
 

+ 1 - 1
gott.go

@@ -205,7 +205,7 @@ func (r *Result) Recover(fn func(...interface{}) (interface{}, error)) *Result {
 				args = append(args, s[i])
 			}
 			args = append(args, r.e)
-			r.s, r.e = fn(args)
+			r.s, r.e = fn(args...)
 		} else {
 			r.s, r.e = fn(r.s, r.e)
 		}

+ 1 - 1
gott_test.go

@@ -8,7 +8,7 @@ import (
 
 func divide5(by ...interface{}) (interface{}, error) {
 	if b := by[0].(int); b == 0 {
-		return nil, errors.New("divideByZero")
+		return Tuple(by), errors.New("divideByZero")
 	} else {
 		return 5 / b, nil
 	}