Skip to content

Commit

Permalink
Merge pull request runatlantis#75 from hootsuite/fix-test
Browse files Browse the repository at this point in the history
Set time location after deserialization
  • Loading branch information
lkysow authored Jul 11, 2017
2 parents 98f4ab5 + 75e3188 commit dc87ccc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions locking/boltdb/boltdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ func (b BoltLocker) GetLock(p models.Project, env string) (*models.ProjectLock,
return nil, errors.Wrapf(err, "deserializing lock at key %q", key)
}

// need to set it to Local after deserialization due to https://github.com/golang/go/issues/19486
lock.Time = lock.Time.Local()
return &lock, nil
}

Expand Down
1 change: 0 additions & 1 deletion locking/boltdb/boltdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ func TestGetLock(t *testing.T) {

l, err := b.GetLock(project, env)
Ok(t, err)
l.Time = l.Time.Local()
Equals(t, &lock, l)
}

Expand Down

0 comments on commit dc87ccc

Please sign in to comment.