Code clean-up (go fmt)

This commit is contained in:
Michael Mayer 2018-09-17 18:40:57 +02:00
parent 0c1f326dc5
commit da77a1230e
6 changed files with 8 additions and 9 deletions

View file

@ -22,7 +22,7 @@ func NewCamera(modelName string) *Camera {
result := &Camera{ result := &Camera{
CameraModel: modelName, CameraModel: modelName,
CameraSlug: cameraSlug, CameraSlug: cameraSlug,
} }
return result return result

View file

@ -13,12 +13,12 @@ import (
type TensorFlow struct { type TensorFlow struct {
modelPath string modelPath string
graph *tf.Graph graph *tf.Graph
labels []string labels []string
} }
func NewTensorFlow(tensorFlowModelPath string) *TensorFlow { func NewTensorFlow(tensorFlowModelPath string) *TensorFlow {
return &TensorFlow{modelPath:tensorFlowModelPath} return &TensorFlow{modelPath: tensorFlowModelPath}
} }
type TensorFlowLabel struct { type TensorFlowLabel struct {
@ -130,7 +130,6 @@ func (t *TensorFlow) findBestLabels(probabilities []float32) []TensorFlowLabel {
return resultLabels[:5] return resultLabels[:5]
} }
func (t *TensorFlow) makeTensorFromImage(image string, imageFormat string) (*tf.Tensor, error) { func (t *TensorFlow) makeTensorFromImage(image string, imageFormat string) (*tf.Tensor, error) {
tensor, err := tf.NewTensor(image) tensor, err := tf.NewTensor(image)
if err != nil { if err != nil {

View file

@ -3,8 +3,8 @@ package server
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
"github.com/photoprism/photoprism/internal/photoprism"
"github.com/photoprism/photoprism/internal/forms" "github.com/photoprism/photoprism/internal/forms"
"github.com/photoprism/photoprism/internal/photoprism"
"net/http" "net/http"
"strconv" "strconv"
) )

View file

@ -9,7 +9,7 @@ import (
func Start(conf *photoprism.Config) { func Start(conf *photoprism.Config) {
if conf.ServerMode != "" { if conf.ServerMode != "" {
gin.SetMode(conf.ServerMode) gin.SetMode(conf.ServerMode)
} else if conf.Debug == false{ } else if conf.Debug == false {
gin.SetMode(gin.ReleaseMode) gin.SetMode(gin.ReleaseMode)
} }