1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-25 08:59:31 -05:00

Vet complains about "should have signature MarshalJSON() ([]byte, error)", replaced with custom name

This commit is contained in:
Thomas Boerger 2016-11-04 12:29:31 +01:00
parent f960b776f0
commit 648c6fdd60
No known key found for this signature in database
GPG key ID: 5A388F55283960B6

View file

@ -367,10 +367,10 @@ type HookTask struct {
func (t *HookTask) BeforeUpdate() { func (t *HookTask) BeforeUpdate() {
if t.RequestInfo != nil { if t.RequestInfo != nil {
t.RequestContent = t.MarshalJSON(t.RequestInfo) t.RequestContent = t.SimpleMarshalJSON(t.RequestInfo)
} }
if t.ResponseInfo != nil { if t.ResponseInfo != nil {
t.ResponseContent = t.MarshalJSON(t.ResponseInfo) t.ResponseContent = t.SimpleMarshalJSON(t.ResponseInfo)
} }
} }
@ -402,7 +402,7 @@ func (t *HookTask) AfterSet(colName string, _ xorm.Cell) {
} }
} }
func (t *HookTask) MarshalJSON(v interface{}) string { func (t *HookTask) SimpleMarshalJSON(v interface{}) string {
p, err := json.Marshal(v) p, err := json.Marshal(v)
if err != nil { if err != nil {
log.Error(3, "Marshal [%d]: %v", t.ID, err) log.Error(3, "Marshal [%d]: %v", t.ID, err)