Skip to content

Commit 95ffd2d

Browse files
Merge pull request #18 from IBM/saikumar1607-202111241032
Changes to IsEnabled() method
2 parents aaecc2f + 14a31b6 commit 95ffd2d

File tree

15 files changed

+292
-58
lines changed

15 files changed

+292
-58
lines changed

.cra/.cveignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"cve": "SNYK-GOLANG-GITHUBCOMGOBUFFALOPACKRV2-1920670",
4+
"expiration": "2021-11-25T08:40:51+05:30",
5+
"comment": "Details on why this is ignored is documented in https://github.ibm.com/devx-app-services/planning/issues/7876"
6+
}
7+
]

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
coverage.out

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "^.secrets.baseline$|go.sum|examples/SampleApp/go.sum|vendor",
44
"lines": null
55
},
6-
"generated_at": "2021-11-10T07:34:54Z",
6+
"generated_at": "2021-11-24T10:34:05Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# IBM Cloud App Configuration Go server SDK
1+
# IBM Cloud App Configuration Go server SDK 0.2.2
22

33
IBM Cloud App Configuration SDK is used to perform feature flag and property evaluation based on the configuration on
44
IBM Cloud App Configuration service.

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Click Save rule & Add the targeting.
9595

9696
```bash
9797
$ cd ./examples
98-
$ go get -u github.com/IBM/appconfiguration-go-sdk
98+
$ go mod tidy
9999
$ go run main.go
100100
```
101101

examples/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module examples
33
go 1.16
44

55
require (
6-
github.com/IBM/appconfiguration-go-sdk v0.2.1
6+
github.com/IBM/appconfiguration-go-sdk v0.2.2
77
github.com/gorilla/mux v1.7.2
8-
)
8+
)

examples/go.sum

Lines changed: 206 additions & 7 deletions
Large diffs are not rendered by default.

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ module github.com/IBM/appconfiguration-go-sdk
22

33
go 1.16
44

5+
replace github.com/gobuffalo/packr/v2 => github.com/gobuffalo/packr/v2 v2.3.2
6+
57
require (
6-
github.com/IBM/go-sdk-core/v5 v5.5.1
8+
github.com/IBM/go-sdk-core/v5 v5.7.0
79
github.com/google/uuid v1.2.0 // indirect
810
github.com/gorilla/websocket v1.4.2
911
github.com/mitchellh/mapstructure v1.4.1 // indirect
1012
github.com/robfig/cron v1.2.0
1113
github.com/sirupsen/logrus v1.7.0
12-
github.com/stretchr/testify v1.6.1
14+
github.com/stretchr/testify v1.7.0
1315
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
1416
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
1517
golang.org/x/text v0.3.6 // indirect
16-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
1718
gopkg.in/yaml.v2 v2.4.0 // indirect
1819
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c
1920
)

go.sum

Lines changed: 35 additions & 30 deletions
Large diffs are not rendered by default.

lib/appconfiguration_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,14 @@ func TestSetContext(t *testing.T) {
8282
reset(ac)
8383

8484
// when collection id and environment id is provided successfully and the number of context options is more than 1
85-
F := false
8685
ac.Init("a", "b", "c")
8786
ac.isInitialized = true
8887
ac.SetContext("c1", "dev", ContextOptions{
8988
BootstrapFile: "saflights/flights.json",
90-
LiveConfigUpdateEnabled: &F,
89+
LiveConfigUpdateEnabled: false,
9190
}, ContextOptions{
9291
BootstrapFile: "saflights/flights.json",
93-
LiveConfigUpdateEnabled: &F,
92+
LiveConfigUpdateEnabled: false,
9493
})
9594
if hook.LastEntry().Message != "AppConfiguration - Incorrect usage of context options. At most of one ContextOptions struct should be passed." {
9695
t.Errorf("Test failed: Incorrect error message")
@@ -103,7 +102,7 @@ func TestSetContext(t *testing.T) {
103102
assert.Equal(t, false, ac.isInitializedConfig)
104103
ac.SetContext("c1", "dev", ContextOptions{
105104
BootstrapFile: "saflights/flights.json",
106-
LiveConfigUpdateEnabled: &F,
105+
LiveConfigUpdateEnabled: false,
107106
})
108107
assert.Equal(t, true, ac.isInitializedConfig)
109108
reset(ac)
@@ -114,9 +113,9 @@ func TestSetContext(t *testing.T) {
114113
assert.Equal(t, false, ac.isInitializedConfig)
115114
ac.SetContext("c1", "dev", ContextOptions{
116115
BootstrapFile: "",
117-
LiveConfigUpdateEnabled: &F,
116+
LiveConfigUpdateEnabled: false,
118117
})
119-
if hook.LastEntry().Message != "AppConfiguration - Provide configuration_file value when live_config_update_enabled is false." {
118+
if hook.LastEntry().Message != "AppConfiguration - Provide bootstrap_file value when live_config_update_enabled is false." {
120119
t.Errorf("Test failed: Incorrect error message")
121120
}
122121
reset(ac)

0 commit comments

Comments
 (0)