Explorar o código

Add CompleteName helper

Andrea Fazzi %!s(int64=6) %!d(string=hai) anos
pai
achega
25ed2837f5
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      orm/teacher.go

+ 5 - 0
orm/teacher.go

@@ -1,6 +1,7 @@
 package orm
 
 import (
+	"fmt"
 	"net/http"
 
 	"github.com/jinzhu/gorm"
@@ -242,3 +243,7 @@ func (t Teacher) IsCoordinatorInClass(className string) bool {
 	return false
 
 }
+
+func (t *Teacher) CompleteName() string {
+	return fmt.Sprintf("%s %s", t.Name, t.Surname)
+}