Codebase list golang-github-spf13-viper / 4bc7c7c
Refresh 0001-Fix-FTBFS-on-32-bit-architectures.patch Anthony Fok 6 years ago
1 changed file(s) with 17 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
00 From: "Dr. Tobias Quathamer" <toddy@debian.org>
11 Date: Wed, 26 Apr 2017 21:56:15 +0200
22 Subject: Fix FTBFS on 32 bit architectures.
3 Forwarded: https://github.com/spf13/viper/pull/340
4 Reviewed-by: Anthony Fok <foka@debian.org>
5 Last-Update: 2017-07-21
36
47 ---
58 viper.go | 4 +++-
69 viper_test.go | 8 --------
710 2 files changed, 3 insertions(+), 9 deletions(-)
811
9 diff --git a/viper.go b/viper.go
10 index 2603c78..b176b8e 100644
1112 --- a/viper.go
1213 +++ b/viper.go
13 @@ -605,8 +605,10 @@ func (v *Viper) Get(key string) interface{} {
14 return cast.ToBool(val)
15 case string:
16 return cast.ToString(val)
17 - case int64, int32, int16, int8, int:
18 + case int32, int16, int8, int:
19 return cast.ToInt(val)
20 + case int64:
21 + return cast.ToInt64(val)
22 case float64, float32:
23 return cast.ToFloat64(val)
24 case time.Time:
25 diff --git a/viper_test.go b/viper_test.go
26 index cd7b65c..189b499 100644
14 @@ -611,8 +611,10 @@
15 return cast.ToBool(val)
16 case string:
17 return cast.ToString(val)
18 - case int64, int32, int16, int8, int:
19 + case int32, int16, int8, int:
20 return cast.ToInt(val)
21 + case int64:
22 + return cast.ToInt64(val)
23 case float64, float32:
24 return cast.ToFloat64(val)
25 case time.Time:
2726 --- a/viper_test.go
2827 +++ b/viper_test.go
29 @@ -841,10 +841,6 @@ func TestMergeConfig(t *testing.T) {
28 @@ -879,10 +879,6 @@
3029 t.Fatalf("pop != 37890, = %d", pop)
3130 }
3231
3736 if pop := v.GetInt64("hello.lagrenum"); pop != int64(765432101234567) {
3837 t.Fatalf("int64 lagrenum != 765432101234567, = %d", pop)
3938 }
40 @@ -865,10 +861,6 @@ func TestMergeConfig(t *testing.T) {
39 @@ -903,10 +899,6 @@
4140 t.Fatalf("pop != 45000, = %d", pop)
4241 }
4342