Fixes gofmt errors
This commit is contained in:
parent
773cafe83d
commit
0e510b23cb
@ -29,7 +29,7 @@ var (
|
||||
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{
|
||||
Use: "ponder",
|
||||
Short: "A managing tool for lilypond sheet music libraries",
|
||||
|
@ -73,7 +73,7 @@ func MakeBook(path string, opts *settings.Settings) {
|
||||
CompileDir(path, opts)
|
||||
// Compile the book template
|
||||
var templ = template.Must(template.New("songBook").Funcs(template.FuncMap{
|
||||
"in": helpers.InSlice,
|
||||
"in": helpers.InSlice,
|
||||
"unknown": unknownCategories,
|
||||
}).Parse(bookTempl))
|
||||
|
||||
@ -136,10 +136,10 @@ func scoreCategories(scores *[]settings.Score) []string {
|
||||
// unknownCategories returns true if the slice contains any scores with
|
||||
// unknown categories
|
||||
func unknownCategories(scores *[]settings.Score) bool {
|
||||
for i := range *scores {
|
||||
if len((*scores)[i].Categories) == 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
for i := range *scores {
|
||||
if len((*scores)[i].Categories) == 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ func CompileDir(path string, opts *settings.Settings) {
|
||||
msg string
|
||||
err error
|
||||
)
|
||||
switch filepath.Ext(scores[i].Path){
|
||||
switch filepath.Ext(scores[i].Path) {
|
||||
case ".ly":
|
||||
msg, err = Lilypond(scores[i].Path)
|
||||
case ".pdf":
|
||||
@ -62,7 +62,7 @@ func CompileDir(path string, opts *settings.Settings) {
|
||||
} else {
|
||||
log.WithFields(log.Fields{
|
||||
"score": scores[i],
|
||||
}).Debug("skipping compilation")
|
||||
}).Debug("skipping compilation")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,10 +16,10 @@ package helpers
|
||||
|
||||
// InSlice returns true if one of the elements in the slice a equals s
|
||||
func InSlice(s string, a []string) bool {
|
||||
for i := range a {
|
||||
if a[i] == s {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
for i := range a {
|
||||
if a[i] == s {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ type Score struct {
|
||||
Name string // The name of the score in the songbook
|
||||
Categories []string `json:",omitempty"` // Categories to which the scores belong
|
||||
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)
|
||||
OutputPath string `json:",omitempty"` // The path on which the compiled version of the score will be placed
|
||||
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
|
||||
}
|
||||
|
||||
// FromJSON reads the settings of a score from a JSON file
|
||||
|
Reference in New Issue
Block a user