Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
fix: fix filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Apr 16, 2020
1 parent a6912da commit c3e054f
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 21 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ require (
github.com/hashicorp/terraform v0.12.19
github.com/leodido/go-urn v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.1.2
github.com/pkg/errors v0.8.1
github.com/sanity-io/litter v1.2.0
github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.4.0
github.com/suzuki-shunsuke/flute v0.7.0
github.com/suzuki-shunsuke/go-jsoneq v0.1.2
github.com/suzuki-shunsuke/go-ptr v1.0.0
github.com/suzuki-shunsuke/go-set v6.0.0+incompatible // indirect
github.com/suzuki-shunsuke/go-set/v6 v6.0.1
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v9 v9.31.0
Expand Down
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,16 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down Expand Up @@ -219,7 +215,6 @@ github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84=
Expand Down Expand Up @@ -300,7 +295,6 @@ github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQw
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
Expand All @@ -320,12 +314,13 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/suzuki-shunsuke/flute v0.7.0 h1:DvDSCMIMiLlRj4AQPMeJ1NfHE3lG5yfs2LU0Dnf1+oc=
github.com/suzuki-shunsuke/flute v0.7.0/go.mod h1:UZOMr3GyEuYSr7/zf0nHgaLP9ZhKDB+2pBeV1WFkohE=
github.com/suzuki-shunsuke/go-cliutil v0.0.0-20181211154308-176f852d9bca/go.mod h1:Vq3NkhgmA9DT/2UZ08x/3A34xxvzQ/vTMABnTWKoMbY=
github.com/suzuki-shunsuke/go-graylog v2.5.0+incompatible h1:6G5hjnyxyLjc1GGksED+wcbQSTNmVzVhkthhVll6HyY=
github.com/suzuki-shunsuke/go-jsoneq v0.1.1/go.mod h1:vbOEb6bPf8nD+QASKzxtQ/vfVGgAyfWHyItUaUTwJWk=
github.com/suzuki-shunsuke/go-jsoneq v0.1.2 h1:A4czEbmFqSELTbrEtXVo4dSgfz2e2Z0y6G3OpExUML8=
github.com/suzuki-shunsuke/go-jsoneq v0.1.2/go.mod h1:ETXAwfruZTqMMKDxc9CYoS34CNSsnzcdcVIAW3+RujI=
github.com/suzuki-shunsuke/go-ptr v1.0.0 h1:sVR6ICMJbdCyOpxzrflHErkO8KmItPFDu0E0PoQR0W8=
github.com/suzuki-shunsuke/go-ptr v1.0.0/go.mod h1:4WKv+CJynv3Veutqvmt7yPUqEsZp0vezqFxVRukjga0=
github.com/suzuki-shunsuke/go-set v6.0.0+incompatible h1:APxAhd/XeHGrrp3vR6a9Yiwgak+HlM+CVREvDAULM8w=
github.com/suzuki-shunsuke/go-set v6.0.0+incompatible/go.mod h1:CZob7MsjSLZlWDHWKeRvDX/Q2eWA6qqbx+FXdy2FgnM=
github.com/suzuki-shunsuke/go-set/v6 v6.0.1 h1:JxqxB+UYnkMqskPZhLrOFLas6SY/Z6yMNOm9kOvwSDY=
github.com/suzuki-shunsuke/go-set/v6 v6.0.1/go.mod h1:3dlTSl52oLMev8ZwgkNkGl3euc+Gm0ehBpfR4g+MdXY=
github.com/suzuki-shunsuke/gomic v0.5.6/go.mod h1:GEDQnxOB07p3mTZG/MiuclfyfcqnNqp0rt9AHgIzs7Q=
Expand Down Expand Up @@ -463,7 +458,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M=
gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion client/view.go → graylog/client/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"errors"

"github.com/suzuki-shunsuke/go-graylog"
"github.com/suzuki-shunsuke/go-graylog/v11/graylog/graylog"
)

// GetViews returns all views.
Expand Down
2 changes: 1 addition & 1 deletion client/view_test.go → graylog/client/view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/suzuki-shunsuke/flute/flute"

"github.com/suzuki-shunsuke/go-graylog/testdata"
"github.com/suzuki-shunsuke/go-graylog/v11/graylog/testdata"
)

func TestClient_GetViews(t *testing.T) {
Expand Down
15 changes: 7 additions & 8 deletions view.go → graylog/graylog/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package graylog

import (
"encoding/json"
"errors"
"fmt"

"github.com/pkg/errors"
)

type (
Expand Down Expand Up @@ -121,7 +120,7 @@ func (widget MessagesViewWidgetConfig) Type() string {
func (widget *ViewWidget) UnmarshalJSON(b []byte) error {
errMsg := "failed to unmarshal JSON to view widget"
if widget == nil {
return fmt.Errorf("%s: view widget is nil", errMsg)
return errors.New(errMsg + ": view widget is nil")
}
type alias ViewWidget
a := struct {
Expand All @@ -132,20 +131,20 @@ func (widget *ViewWidget) UnmarshalJSON(b []byte) error {
alias: (*alias)(widget),
}
if err := json.Unmarshal(b, &a); err != nil {
return errors.Wrap(err, errMsg)
return fmt.Errorf(errMsg+": %w", err)
}
switch a.Type {
case "aggregation":
p := AggregationViewWidgetConfig{}
if err := json.Unmarshal(a.Config, &p); err != nil {
return errors.Wrap(err, errMsg)
return fmt.Errorf(errMsg+": %w", err)
}
widget.Config = p
return nil
case "messages":
p := MessagesViewWidgetConfig{}
if err := json.Unmarshal(a.Config, &p); err != nil {
return errors.Wrap(err, errMsg)
return fmt.Errorf(errMsg+": %w", err)
}
widget.Config = p
return nil
Expand All @@ -158,7 +157,7 @@ func (widget *ViewWidget) UnmarshalJSON(b []byte) error {
func (position *ViewWidgetPosition) UnmarshalJSON(b []byte) error {
errMsg := "failed to unmarshal JSON to view widget position"
if position == nil {
return fmt.Errorf("%s: view widget position is nil", errMsg)
return errors.New(errMsg + ": view widget position is nil")
}
type alias ViewWidgetPosition

Expand All @@ -180,7 +179,7 @@ func (position *ViewWidgetPosition) UnmarshalJSON(b []byte) error {
alias: (*alias)(position),
}
if err := json.Unmarshal(b, &c); err != nil {
return errors.Wrap(err, errMsg)
return fmt.Errorf(errMsg+": %w", err)
}
if i, err := c.Width.Int64(); err == nil {
position.Width = int(i)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package graylog
package terraform

import (
"context"

"github.com/hashicorp/terraform/helper/schema"
"github.com/suzuki-shunsuke/go-graylog"
"github.com/suzuki-shunsuke/go-graylog/v11/graylog/graylog"
)

func resourceView() *schema.Resource {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion testdata/views.go → graylog/testdata/views.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package testdata

import (
"github.com/suzuki-shunsuke/go-graylog"
"github.com/suzuki-shunsuke/go-graylog/v11/graylog/graylog"
)

var (
Expand Down
File renamed without changes.

0 comments on commit c3e054f

Please sign in to comment.