aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/gogits/go-gogs-client/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gogits/go-gogs-client/user.go')
-rw-r--r--vendor/github.com/gogits/go-gogs-client/user.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/vendor/github.com/gogits/go-gogs-client/user.go b/vendor/github.com/gogits/go-gogs-client/user.go
index b385b041..3879b1a6 100644
--- a/vendor/github.com/gogits/go-gogs-client/user.go
+++ b/vendor/github.com/gogits/go-gogs-client/user.go
@@ -18,12 +18,13 @@ type User struct {
AvatarUrl string `json:"avatar_url"`
}
-// MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility
+// MarshalJSON implements the json.Marshaler interface for User
func (u User) MarshalJSON() ([]byte, error) {
// Re-declaring User to avoid recursion
type shadow User
return json.Marshal(struct {
shadow
+ // LEGACY [Gogs 1.0]: remove field(s) for backward compatibility
CompatUserName string `json:"username"`
}{shadow(u), u.UserName})
}