From 613139e7bef81d3573e7988a47eb6765f3de347a Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 23 Oct 2019 23:03:17 -0700 Subject: Enable Go modules (#5835) * Remove vendor * Enable Go modules * ci: add command to fetch dependencies * ci: update setting * ci: update settings * Require Go 1.11 * Rename module name to gogs.io/gogs --- .../smartystreets/assertions/serializer.go | 70 ---------------------- 1 file changed, 70 deletions(-) delete mode 100644 vendor/github.com/smartystreets/assertions/serializer.go (limited to 'vendor/github.com/smartystreets/assertions/serializer.go') diff --git a/vendor/github.com/smartystreets/assertions/serializer.go b/vendor/github.com/smartystreets/assertions/serializer.go deleted file mode 100644 index f1e3570e..00000000 --- a/vendor/github.com/smartystreets/assertions/serializer.go +++ /dev/null @@ -1,70 +0,0 @@ -package assertions - -import ( - "encoding/json" - "fmt" - "strings" - - "github.com/smartystreets/assertions/internal/go-render/render" -) - -type Serializer interface { - serialize(expected, actual interface{}, message string) string - serializeDetailed(expected, actual interface{}, message string) string -} - -type failureSerializer struct{} - -func (self *failureSerializer) serializeDetailed(expected, actual interface{}, message string) string { - if index := strings.Index(message, " Diff:"); index > 0 { - message = message[:index] - } - view := FailureView{ - Message: message, - Expected: render.Render(expected), - Actual: render.Render(actual), - } - serialized, _ := json.Marshal(view) - return string(serialized) -} - -func (self *failureSerializer) serialize(expected, actual interface{}, message string) string { - if index := strings.Index(message, " Diff:"); index > 0 { - message = message[:index] - } - view := FailureView{ - Message: message, - Expected: fmt.Sprintf("%+v", expected), - Actual: fmt.Sprintf("%+v", actual), - } - serialized, _ := json.Marshal(view) - return string(serialized) -} - -func newSerializer() *failureSerializer { - return &failureSerializer{} -} - -/////////////////////////////////////////////////////////////////////////////// - -// This struct is also declared in github.com/smartystreets/goconvey/convey/reporting. -// The json struct tags should be equal in both declarations. -type FailureView struct { - Message string `json:"Message"` - Expected string `json:"Expected"` - Actual string `json:"Actual"` -} - -/////////////////////////////////////////////////////// - -// noopSerializer just gives back the original message. This is useful when we are using -// the assertions from a context other than the GoConvey Web UI, that requires the JSON -// structure provided by the failureSerializer. -type noopSerializer struct{} - -func (self *noopSerializer) serialize(expected, actual interface{}, message string) string { - return message -} -func (self *noopSerializer) serializeDetailed(expected, actual interface{}, message string) string { - return message -} -- cgit v1.2.3