fixup! run gofumpt / format comments / comment blocks
This commit is contained in:
@@ -18,9 +18,10 @@ import (
|
|||||||
// once i had this written with ~100% text/template but it was very
|
// once i had this written with ~100% text/template but it was very
|
||||||
// slow. now this thing is not nice on the eyes or easy to change
|
// slow. now this thing is not nice on the eyes or easy to change
|
||||||
// but it's pretty fast. which i needed it to for live reloading stuff
|
// but it's pretty fast. which i needed it to for live reloading stuff
|
||||||
|
|
||||||
const (
|
const (
|
||||||
byteCols = 24
|
byteCols = 24
|
||||||
// begin file template
|
// ** begin file template
|
||||||
fileHeader = `// file generated with embed tool
|
fileHeader = `// file generated with embed tool
|
||||||
// do not edit
|
// do not edit
|
||||||
// %s
|
// %s
|
||||||
@@ -33,7 +34,7 @@ type EmbeddedAsset struct {
|
|||||||
var %s = map[string]*EmbeddedAsset{`
|
var %s = map[string]*EmbeddedAsset{`
|
||||||
fileFooter = `
|
fileFooter = `
|
||||||
}`
|
}`
|
||||||
// begin asset template
|
// ** begin asset template
|
||||||
assetHeader = `
|
assetHeader = `
|
||||||
%q: &EmbeddedAsset{
|
%q: &EmbeddedAsset{
|
||||||
ModTime: time.Unix(%d, 0),
|
ModTime: time.Unix(%d, 0),
|
||||||
@@ -104,9 +105,7 @@ func processAssets(c *config, files []string) error {
|
|||||||
return errors.Wrap(err, "opening asset")
|
return errors.Wrap(err, "opening asset")
|
||||||
}
|
}
|
||||||
defer data.Close()
|
defer data.Close()
|
||||||
processAsset(
|
processAsset(c, &file{
|
||||||
c,
|
|
||||||
&file{
|
|
||||||
data: data,
|
data: data,
|
||||||
path: path,
|
path: path,
|
||||||
modTime: info.ModTime(),
|
modTime: info.ModTime(),
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// $ date '+%Y%m%d%H%M'
|
// $ date '+%Y%m%d%H%M'
|
||||||
|
|
||||||
// not really a migration
|
// not really a migration
|
||||||
var migrationInitSchema = gormigrate.Migration{
|
var migrationInitSchema = gormigrate.Migration{
|
||||||
ID: "202002192100",
|
ID: "202002192100",
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ func (t *Tags) firstTag(keys ...string) string {
|
|||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Tags) Title() string { return t.firstTag("title") }
|
func (t *Tags) Title() string { return t.firstTag("title") }
|
||||||
func (t *Tags) BrainzID() string { return t.firstTag("musicbrainz_trackid") }
|
func (t *Tags) BrainzID() string { return t.firstTag("musicbrainz_trackid") }
|
||||||
func (t *Tags) Artist() string { return t.firstTag("artist") }
|
func (t *Tags) Artist() string { return t.firstTag("artist") }
|
||||||
@@ -44,6 +45,7 @@ func (t *Tags) TrackNumber() int { return intSep(t.firstTag("tracknumber"),
|
|||||||
func (t *Tags) DiscNumber() int { return intSep(t.firstTag("discnumber"), "/") } // eg. 1/2
|
func (t *Tags) DiscNumber() int { return intSep(t.firstTag("discnumber"), "/") } // eg. 1/2
|
||||||
func (t *Tags) Length() int { return t.props.Length }
|
func (t *Tags) Length() int { return t.props.Length }
|
||||||
func (t *Tags) Bitrate() int { return t.props.Bitrate }
|
func (t *Tags) Bitrate() int { return t.props.Bitrate }
|
||||||
|
|
||||||
func intSep(in, sep string) int {
|
func intSep(in, sep string) int {
|
||||||
if in == "" {
|
if in == "" {
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user