Skip to content

Commit

Permalink
Fixing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Aug 30, 2024
1 parent df05b67 commit e7f0f42
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions services/creator/types/video/video.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,22 @@ func (t Tag) Value() (driver.Value, error) {

func (t *Tag) Scan(src interface{}) (err error) {
var tags []string
//nolint:gosimple
switch src.(type) {
case string:
fmt.Println("string")
err = json.Unmarshal([]byte(src.(string)), &tags)
if err != nil {
return
}
case []byte:
fmt.Println("[]byte")
fmt.Println(string(src.([]byte)))
temp := string(src.([]byte))

temp = strings.TrimLeft(temp, "{")
temp = strings.TrimRight(temp, "}")
tags = strings.Split(temp, ",")
default:
return errors.New("incompatible type for Tag")
}
if err != nil {
return
}

*t = tags
return nil
}

0 comments on commit e7f0f42

Please sign in to comment.