Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aws/aws-lambda-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.13.1
Choose a base ref
...
head repository: aws/aws-lambda-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.13.2
Choose a head ref
  • 2 commits
  • 5 files changed
  • 2 contributors

Commits on Sep 12, 2019

  1. Copy the full SHA
    68877f4 View commit details
  2. Fix Precision issue with Durations (#229)

    * Fix Precision issue with Durations
    
    * CloudWatchEvents seem to return with precision 60.0 instead of 60
    * Change tests to match
    * Change types to float64
    
    * Mix ints and floats
    whithajess authored and bmoffatt committed Sep 12, 2019
    Copy the full SHA
    e5086e5 View commit details
Showing with 28 additions and 21 deletions.
  1. +2 −2 events/duration.go
  2. +8 −8 events/testdata/codebuild-phase-change.json
  3. +5 −5 events/testdata/codebuild-state-change.json
  4. +2 −2 go.mod
  5. +11 −4 go.sum
4 changes: 2 additions & 2 deletions events/duration.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import (
type DurationSeconds time.Duration

func (duration *DurationSeconds) UnmarshalJSON(data []byte) error {
var seconds int64
var seconds float64
if err := json.Unmarshal(data, &seconds); err != nil {
return err
}
@@ -26,7 +26,7 @@ func (duration DurationSeconds) MarshalJSON() ([]byte, error) {
type DurationMinutes time.Duration

func (duration *DurationMinutes) UnmarshalJSON(data []byte) error {
var minutes int64
var minutes float64
if err := json.Unmarshal(data, &minutes); err != nil {
return err
}
16 changes: 8 additions & 8 deletions events/testdata/codebuild-phase-change.json
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
"type": "LINUX_CONTAINER",
"environment-variables": []
},
"timeout-in-minutes": 60,
"timeout-in-minutes": 60.0,
"build-complete": true,
"initiator": "MyCodeBuildDemoUser",
"build-start-time": "Sep 1, 2017 4:12:29 PM",
@@ -45,7 +45,7 @@
"phase-context": [],
"start-time": "Sep 1, 2017 4:12:29 PM",
"end-time": "Sep 1, 2017 4:12:29 PM",
"duration-in-seconds": 0,
"duration-in-seconds": 0.0,
"phase-type": "SUBMITTED",
"phase-status": "SUCCEEDED"
},
@@ -61,7 +61,7 @@
"phase-context": [],
"start-time": "Sep 1, 2017 4:13:05 PM",
"end-time": "Sep 1, 2017 4:13:10 PM",
"duration-in-seconds": 4,
"duration-in-seconds": 4.0,
"phase-type": "DOWNLOAD_SOURCE",
"phase-status": "SUCCEEDED"
},
@@ -77,7 +77,7 @@
"phase-context": [],
"start-time": "Sep 1, 2017 4:13:10 PM",
"end-time": "Sep 1, 2017 4:13:10 PM",
"duration-in-seconds": 0,
"duration-in-seconds": 0.0,
"phase-type": "PRE_BUILD",
"phase-status": "SUCCEEDED"
},
@@ -93,7 +93,7 @@
"phase-context": [],
"start-time": "Sep 1, 2017 4:14:21 PM",
"end-time": "Sep 1, 2017 4:14:21 PM",
"duration-in-seconds": 0,
"duration-in-seconds": 0.0,
"phase-type": "POST_BUILD",
"phase-status": "SUCCEEDED"
},
@@ -109,7 +109,7 @@
"phase-context": [],
"start-time": "Sep 1, 2017 4:14:21 PM",
"end-time": "Sep 1, 2017 4:14:26 PM",
"duration-in-seconds": 4,
"duration-in-seconds": 4.0,
"phase-type": "FINALIZING",
"phase-status": "SUCCEEDED"
},
@@ -120,9 +120,9 @@
]
},
"completed-phase-status": "SUCCEEDED",
"completed-phase-duration-seconds": 4,
"completed-phase-duration-seconds": 4.0,
"version": "1",
"completed-phase-start": "Sep 1, 2017 4:14:21 PM",
"completed-phase-end": "Sep 1, 2017 4:14:26 PM"
}
}
}
10 changes: 5 additions & 5 deletions events/testdata/codebuild-state-change.json
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
}
]
},
"timeout-in-minutes": 60,
"timeout-in-minutes": 60.0,
"build-complete": true,
"initiator": "MyCodeBuildDemoUser",
"build-start-time": "Sep 1, 2017 4:12:29 PM",
@@ -58,7 +58,7 @@
"phase-context": [],
"start-time": "Sep 1, 2017 4:12:29 PM",
"end-time": "Sep 1, 2017 4:13:05 PM",
"duration-in-seconds": 36,
"duration-in-seconds": 36.0,
"phase-type": "PROVISIONING",
"phase-status": "SUCCEEDED"
},
@@ -74,7 +74,7 @@
"phase-context": [],
"start-time": "Sep 1, 2017 4:13:10 PM",
"end-time": "Sep 1, 2017 4:13:10 PM",
"duration-in-seconds": 0,
"duration-in-seconds": 0.0,
"phase-type": "INSTALL",
"phase-status": "SUCCEEDED"
},
@@ -90,7 +90,7 @@
"phase-context": [],
"start-time": "Sep 1, 2017 4:13:10 PM",
"end-time": "Sep 1, 2017 4:14:21 PM",
"duration-in-seconds": 70,
"duration-in-seconds": 70.0,
"phase-type": "BUILD",
"phase-status": "SUCCEEDED"
},
@@ -106,7 +106,7 @@
"phase-context": [],
"start-time": "Sep 1, 2017 4:14:21 PM",
"end-time": "Sep 1, 2017 4:14:21 PM",
"duration-in-seconds": 0,
"duration-in-seconds": 0.0,
"phase-type": "UPLOAD_ARTIFACTS",
"phase-status": "SUCCEEDED"
},
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@ module github.com/aws/aws-lambda-go
go 1.12

require (
github.com/stretchr/testify v1.3.0
github.com/urfave/cli v1.21.0
github.com/stretchr/testify v1.4.0
github.com/urfave/cli v1.22.1
)
15 changes: 11 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/urfave/cli v1.21.0 h1:wYSSj06510qPIzGSua9ZqsncMmWE3Zr55KBERygyrxE=
github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=