Skip to content

Commit 16177ab

Browse files
prepare 2.2.1 release (#15)
1 parent 2a8e5b3 commit 16177ab

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.circleci/config.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
win: circleci/windows@1.0.0
4+
win: circleci/windows@2.4.0
55

66
workflows:
77
workflow:
@@ -87,14 +87,23 @@ jobs:
8787

8888
go-test-windows:
8989
executor:
90-
name: win/vs2019
90+
name: win/default
9191
shell: powershell.exe
9292

9393
environment:
9494
GOPATH: C:\Users\VssAdministrator\go
9595

9696
steps:
9797
- checkout
98+
- run:
99+
name: download Go 1.14.13
100+
command: |
101+
$ErrorActionPreference = "Stop"
102+
$installerUrl = "https://golang.org/dl/go1.14.13.windows-amd64.msi"
103+
(New-Object System.Net.WebClient).DownloadFile($installerUrl, "go1.14.13.windows-amd64.msi")
104+
- run:
105+
name: install Go 1.14.13
106+
command: Start-Process msiexec.exe -Wait -ArgumentList "/I go1.14.13.windows-amd64.msi /quiet"
98107
- run: go version
99108
- run:
100109
name: build and test

lduser/user_serialization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (u *User) ReadFromJSONReader(r *jreader.Reader) {
9191
case "custom":
9292
parsed.custom.ReadFromJSONReader(r)
9393
case "privateAttributeNames":
94-
for arr := r.Array(); arr.Next(); {
94+
for arr := r.ArrayOrNull(); arr.Next(); {
9595
s := r.String()
9696
if r.Error() == nil {
9797
if parsed.privateAttributes == nil {

lduser/user_serialization_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ func TestJSONUnmarshalPrivateAttributes(t *testing.T) {
164164
assert.True(t, user2.IsPrivateAttribute("name"))
165165
}
166166

167+
func TestJSONUnmarshalNullsAreAllowedForArraysAndObjects(t *testing.T) {
168+
user := unmarshalUser(t, map[string]interface{}{"key": "some-key", "custom": nil, "privateAttributeNames": nil})
169+
assert.Equal(t, ldvalue.ValueMap{}, user.custom)
170+
assert.Nil(t, user.privateAttributes)
171+
}
172+
167173
func TestJSONUnmarshalDataWithWrongFieldType(t *testing.T) {
168174
var user User
169175
err := json.Unmarshal([]byte(`{"key":[1,2,3]}`), &user)

0 commit comments

Comments
 (0)