model pointer string representation.
This commit is contained in:
parent
52a680dcd7
commit
6cd80ca66a
7 changed files with 35 additions and 0 deletions
models
|
@ -2,6 +2,7 @@ package models
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
@ -20,6 +21,10 @@ type User struct {
|
|||
DeletedAt NullTime `db:"deleted_at" json:"deletedAt"`
|
||||
}
|
||||
|
||||
func (m *User) String() string {
|
||||
return fmt.Sprintf("%v", *m)
|
||||
}
|
||||
|
||||
func NewUser() *User {
|
||||
return &User{Username: "Test User"}
|
||||
}
|
||||
|
|
Reference in a new issue