model pointer string representation.

This commit is contained in:
Matthew Dillon 2015-01-09 06:40:18 -09:00
parent 52a680dcd7
commit 6cd80ca66a
7 changed files with 35 additions and 0 deletions
models

View file

@ -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"}
}