Archived
1
0

Fixes gofmt errors

This commit is contained in:
Jip J. Dekker 2016-04-14 13:28:46 +02:00
parent 773cafe83d
commit 0e510b23cb
5 changed files with 18 additions and 18 deletions

View File

@ -29,7 +29,7 @@ var (
verbose bool verbose bool
) )
// This represents the base command when called without any subcommands // RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{ var RootCmd = &cobra.Command{
Use: "ponder", Use: "ponder",
Short: "A managing tool for lilypond sheet music libraries", Short: "A managing tool for lilypond sheet music libraries",

View File

@ -73,7 +73,7 @@ func MakeBook(path string, opts *settings.Settings) {
CompileDir(path, opts) CompileDir(path, opts)
// Compile the book template // Compile the book template
var templ = template.Must(template.New("songBook").Funcs(template.FuncMap{ var templ = template.Must(template.New("songBook").Funcs(template.FuncMap{
"in": helpers.InSlice, "in": helpers.InSlice,
"unknown": unknownCategories, "unknown": unknownCategories,
}).Parse(bookTempl)) }).Parse(bookTempl))
@ -136,10 +136,10 @@ func scoreCategories(scores *[]settings.Score) []string {
// unknownCategories returns true if the slice contains any scores with // unknownCategories returns true if the slice contains any scores with
// unknown categories // unknown categories
func unknownCategories(scores *[]settings.Score) bool { func unknownCategories(scores *[]settings.Score) bool {
for i := range *scores { for i := range *scores {
if len((*scores)[i].Categories) == 0 { if len((*scores)[i].Categories) == 0 {
return true return true
} }
} }
return false return false
} }

View File

@ -45,7 +45,7 @@ func CompileDir(path string, opts *settings.Settings) {
msg string msg string
err error err error
) )
switch filepath.Ext(scores[i].Path){ switch filepath.Ext(scores[i].Path) {
case ".ly": case ".ly":
msg, err = Lilypond(scores[i].Path) msg, err = Lilypond(scores[i].Path)
case ".pdf": case ".pdf":
@ -62,7 +62,7 @@ func CompileDir(path string, opts *settings.Settings) {
} else { } else {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"score": scores[i], "score": scores[i],
}).Debug("skipping compilation") }).Debug("skipping compilation")
} }
} }
} }

View File

@ -16,10 +16,10 @@ package helpers
// InSlice returns true if one of the elements in the slice a equals s // InSlice returns true if one of the elements in the slice a equals s
func InSlice(s string, a []string) bool { func InSlice(s string, a []string) bool {
for i := range a { for i := range a {
if a[i] == s { if a[i] == s {
return true return true
} }
} }
return false return false
} }

View File

@ -30,8 +30,8 @@ type Score struct {
Name string // The name of the score in the songbook Name string // The name of the score in the songbook
Categories []string `json:",omitempty"` // Categories to which the scores belong Categories []string `json:",omitempty"` // Categories to which the scores belong
Path string // The path to the scores (uncompiled) file Path string // The path to the scores (uncompiled) file
LastModified time.Time `json:"-"` // Time when the score source was last modified (will be set internally) LastModified time.Time `json:"-"` // Time when the score source was last modified (will be set internally)
OutputPath string `json:",omitempty"` // The path on which the compiled version of the score will be placed OutputPath string `json:",omitempty"` // The path on which the compiled version of the score will be placed
} }
// FromJSON reads the settings of a score from a JSON file // FromJSON reads the settings of a score from a JSON file