Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Fixing govet error: composite literal uses unkeyed fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyfay committed Oct 22, 2015
1 parent 57b0bd7 commit a91eddf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions control/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ func TestPluginConfig(t *testing.T) {
cfg.Plugins.All.AddItem("gvar", ctypes.ConfigValueBool{Value: true})
So(len(cfg.Plugins.All.Table()), ShouldEqual, 1)
Convey("with an entry for ALL collector plugins", func() {
cfg.Plugins.Collector.All.AddItem("user", ctypes.ConfigValueStr{"jane"})
cfg.Plugins.Collector.All.AddItem("password", ctypes.ConfigValueStr{"P@ssw0rd"})
cfg.Plugins.Collector.All.AddItem("user", ctypes.ConfigValueStr{Value: "jane"})
cfg.Plugins.Collector.All.AddItem("password", ctypes.ConfigValueStr{Value: "P@ssw0rd"})
So(len(cfg.Plugins.Collector.All.Table()), ShouldEqual, 2)
Convey("an entry for a specific plugin of any version", func() {
cfg.Plugins.Collector.Plugins["test"] = newPluginConfigItem(optAddPluginConfigItem("user", ctypes.ConfigValueStr{"john"}))
cfg.Plugins.Collector.Plugins["test"] = newPluginConfigItem(optAddPluginConfigItem("user", ctypes.ConfigValueStr{Value: "john"}))
So(len(cfg.Plugins.Collector.Plugins["test"].Table()), ShouldEqual, 1)
Convey("and an entry for a specific plugin of a specific version", func() {
cfg.Plugins.Collector.Plugins["test"].Versions[1] = cdata.NewNode()
Expand All @@ -51,7 +51,7 @@ func TestPluginConfig(t *testing.T) {
Convey("we can get the merged conf for the given plugin", func() {
cd := cfg.Plugins.getPluginConfigDataNode(core.CollectorPluginType, "test", 1)
So(len(cd.Table()), ShouldEqual, 4)
So(cd.Table()["user"], ShouldResemble, ctypes.ConfigValueStr{"john"})
So(cd.Table()["user"], ShouldResemble, ctypes.ConfigValueStr{Value: "john"})
})
})
})
Expand Down
8 changes: 4 additions & 4 deletions mgmt/rest/rest_func_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ func TestPluginRestCalls(t *testing.T) {
col := core.CollectorPluginType
Convey("A global plugin config is added for all plugins", func() {
cdn := cdata.NewNode()
cdn.AddItem("password", ctypes.ConfigValueStr{"p@ssw0rd"})
cdn.AddItem("password", ctypes.ConfigValueStr{Value: "p@ssw0rd"})
r := setPluginConfigItem(port, "", "", "", cdn)
So(r.Body, ShouldHaveSameTypeAs, &rbody.SetPluginConfigItem{})
r1 := r.Body.(*rbody.SetPluginConfigItem)
Expand All @@ -489,7 +489,7 @@ func TestPluginRestCalls(t *testing.T) {

Convey("A plugin config is added for all publishers", func() {
cdn := cdata.NewNode()
cdn.AddItem("user", ctypes.ConfigValueStr{"john"})
cdn.AddItem("user", ctypes.ConfigValueStr{Value: "john"})
r := setPluginConfigItem(port, core.PublisherPluginType.String(), "", "", cdn)
So(r.Body, ShouldHaveSameTypeAs, &rbody.SetPluginConfigItem{})
r1 := r.Body.(*rbody.SetPluginConfigItem)
Expand All @@ -498,7 +498,7 @@ func TestPluginRestCalls(t *testing.T) {

Convey("A plugin config is added for all versions of a publisher", func() {
cdn := cdata.NewNode()
cdn.AddItem("path", ctypes.ConfigValueStr{"/usr/local/influxdb/bin"})
cdn.AddItem("path", ctypes.ConfigValueStr{Value: "/usr/local/influxdb/bin"})
r := setPluginConfigItem(port, "2", "influxdb", "", cdn)
So(r.Body, ShouldHaveSameTypeAs, &rbody.SetPluginConfigItem{})
r1 := r.Body.(*rbody.SetPluginConfigItem)
Expand All @@ -507,7 +507,7 @@ func TestPluginRestCalls(t *testing.T) {

Convey("A plugin config is added for a specific version of a publisher", func() {
cdn := cdata.NewNode()
cdn.AddItem("rate", ctypes.ConfigValueFloat{.8})
cdn.AddItem("rate", ctypes.ConfigValueFloat{Value: .8})
r := setPluginConfigItem(port, core.PublisherPluginType.String(), "influxdb", "", cdn)
So(r.Body, ShouldHaveSameTypeAs, &rbody.SetPluginConfigItem{})
r1 := r.Body.(*rbody.SetPluginConfigItem)
Expand Down

0 comments on commit a91eddf

Please sign in to comment.