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

View file

@ -2,6 +2,7 @@ package models
import (
"errors"
"fmt"
"net/http"
"strconv"
"time"
@ -19,6 +20,10 @@ type Species struct {
DeletedAt NullTime `db:"deleted_at" json:"deletedAt"`
}
func (m *Species) String() string {
return fmt.Sprintf("%v", *m)
}
func NewSpecies() *Species {
return &Species{SpeciesName: "Test Species"}
}