Browse Source

Don't define methods both on instance and pointer

See https://go.dev/tour/methods/8
jvoisin 1 year ago
parent
commit
9657bf1f5b
2 changed files with 3 additions and 3 deletions
  1. 2 2
      internal/model/app_session.go
  2. 1 1
      internal/model/enclosure.go

+ 2 - 2
internal/model/app_session.go

@@ -24,7 +24,7 @@ type SessionData struct {
 	WebAuthnSessionData WebAuthnSession `json:"webauthn_session_data"`
 }
 
-func (s SessionData) String() string {
+func (s *SessionData) String() string {
 	return fmt.Sprintf(`CSRF=%q, OAuth2State=%q, OAuth2CodeVerifier=%q, FlashMsg=%q, FlashErrMsg=%q, Lang=%q, Theme=%q, PocketTkn=%q, LastForceRefresh=%s, WebAuthnSession=%q`,
 		s.CSRF,
 		s.OAuth2State,
@@ -40,7 +40,7 @@ func (s SessionData) String() string {
 }
 
 // Value converts the session data to JSON.
-func (s SessionData) Value() (driver.Value, error) {
+func (s *SessionData) Value() (driver.Value, error) {
 	j, err := json.Marshal(s)
 	return j, err
 }

+ 1 - 1
internal/model/enclosure.go

@@ -28,7 +28,7 @@ type EnclosureUpdateRequest struct {
 }
 
 // Html5MimeType will modify the actual MimeType to allow direct playback from HTML5 player for some kind of MimeType
-func (e Enclosure) Html5MimeType() string {
+func (e *Enclosure) Html5MimeType() string {
 	if e.MimeType == "video/m4v" {
 		return "video/x-m4v"
 	}