summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flags.go6
-rw-r--r--main.go2
-rw-r--r--model/recipe.go2
-rw-r--r--model/recipes.go8
-rw-r--r--model/recipes_test.go6
-rw-r--r--model/step.go12
-rw-r--r--view/index_test.go2
-rw-r--r--view/recipe.go2
8 files changed, 20 insertions, 20 deletions
diff --git a/flags.go b/flags.go
index a7a95e5..3d4c985 100644
--- a/flags.go
+++ b/flags.go
@@ -24,13 +24,13 @@ var flags struct {
func init() {
flag.BoolVar(&flags.version, "version", false, "print version information")
- flag.BoolVar(&flags.version, "v", false, "print version information")
+ flag.BoolVar(&flags.version, "v", false, "print version information")
flag.StringVar(&flags.config, "config", "", "file path to configuration file")
- flag.StringVar(&flags.config, "c", "", "file path to configuration file")
+ flag.StringVar(&flags.config, "c", "", "file path to configuration file")
flag.BoolVar(&flags.examples, "examples", false, "inject example recipes on startup")
- flag.BoolVar(&flags.examples, "e", false, "inject example recipes on startup")
+ flag.BoolVar(&flags.examples, "e", false, "inject example recipes on startup")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), help)
diff --git a/main.go b/main.go
index b77c803..f744206 100644
--- a/main.go
+++ b/main.go
@@ -6,8 +6,8 @@ import (
"log"
"os"
"os/signal"
- "syscall"
"path/filepath"
+ "syscall"
"xengineering.eu/ceres/model"
)
diff --git a/model/recipe.go b/model/recipe.go
index e49c188..fc2ae3a 100644
--- a/model/recipe.go
+++ b/model/recipe.go
@@ -304,7 +304,7 @@ func RecipeTestData() []Recipe {
Notes: "Delicious!",
Created: "1715658069",
LastChanged: "1715958070",
- Steps: []Step{},
+ Steps: []Step{},
},
}
}
diff --git a/model/recipes.go b/model/recipes.go
index 7604fe2..fd8115f 100644
--- a/model/recipes.go
+++ b/model/recipes.go
@@ -5,8 +5,8 @@ import (
)
type RecipesElement struct {
- Id int64 // TODO change to string
- Title string
+ Id int64 // TODO change to string
+ Title string
}
type Recipes []RecipesElement
@@ -39,11 +39,11 @@ func (r *Recipes) Read() error {
func RecipesTestData() Recipes {
return []RecipesElement{
{
- Id: 1,
+ Id: 1,
Title: "Pancakes",
},
{
- Id: 2,
+ Id: 2,
Title: "Burger",
},
}
diff --git a/model/recipes_test.go b/model/recipes_test.go
index 13a8b2f..ddd1543 100644
--- a/model/recipes_test.go
+++ b/model/recipes_test.go
@@ -1,10 +1,10 @@
package model
import (
- "testing"
- "os"
"fmt"
+ "os"
"path/filepath"
+ "testing"
)
func TestRecipesRead(t *testing.T) {
@@ -31,7 +31,7 @@ func TestRecipesRead(t *testing.T) {
t.Fatalf("Failed to read Recipes: %v\n", err)
}
- if len(r) != 2 { // TODO this needs to be aligned with model/testrecipes.go
+ if len(r) != 2 { // TODO this needs to be aligned with model/testrecipes.go
t.Fatalf("Expected a list of one recipe but got %d", len(r))
}
}
diff --git a/model/step.go b/model/step.go
index 89a9efd..b996e3a 100644
--- a/model/step.go
+++ b/model/step.go
@@ -1,17 +1,17 @@
package model
import (
- "errors"
- "encoding/json"
"database/sql"
+ "encoding/json"
+ "errors"
"fmt"
)
type Step struct {
- Id string `json:"id"`
- Index string `json:"index"`
- Text string `json:"text"`
- Recipe string `json:"recipe"`
+ Id string `json:"id"`
+ Index string `json:"index"`
+ Text string `json:"text"`
+ Recipe string `json:"recipe"`
Ingredients []Ingredient `json:"ingredients"`
}
diff --git a/view/index_test.go b/view/index_test.go
index 583032c..3ab35d5 100644
--- a/view/index_test.go
+++ b/view/index_test.go
@@ -1,9 +1,9 @@
package view
import (
- "testing"
"net/http"
"net/http/httptest"
+ "testing"
)
func TestIndexRead(t *testing.T) {
diff --git a/view/recipe.go b/view/recipe.go
index 8236476..d77d771 100644
--- a/view/recipe.go
+++ b/view/recipe.go
@@ -41,7 +41,7 @@ func RecipeRead(w http.ResponseWriter, r *http.Request) {
}
}
if !is_valid {
- http.Error(w, "Unsupported view: " + template, http.StatusBadRequest)
+ http.Error(w, "Unsupported view: "+template, http.StatusBadRequest)
return
}