var sigs = make(chan os.Signal)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
- for i, _ := range baseURLs {
+ for i := range baseURLs {
mu, serverURL, endpoint, err := srv.createEndpoint(i)
if doLiveReload {
//cwd, _ := os.Getwd()
data := []test{
- //{cwd, nil},
- // Commenting this out. It doesn't work properly.
- // There's a good reason why we don't use os.Getwd(), it doesn't actually work the way we want it to.
- // I really don't know a better way to test this function. - SPF 2014.11.04
+ //{cwd, nil},
+ // Commenting this out. It doesn't work properly.
+ // There's a good reason why we don't use os.Getwd(), it doesn't actually work the way we want it to.
+ // I really don't know a better way to test this function. - SPF 2014.11.04
}
for i, d := range data {
dir, err := FindCWD()
func (s *ProcessingStats) toVals() []processingStatsTitleVal {
return []processingStatsTitleVal{
- processingStatsTitleVal{"Pages", s.Pages},
- processingStatsTitleVal{"Paginator pages", s.PaginatorPages},
- processingStatsTitleVal{"Non-page files", s.Files},
- processingStatsTitleVal{"Static files", s.Static},
- processingStatsTitleVal{"Processed images", s.ProcessedImages},
- processingStatsTitleVal{"Aliases", s.Aliases},
- processingStatsTitleVal{"Sitemaps", s.Sitemaps},
- processingStatsTitleVal{"Cleaned", s.Cleaned},
+ {"Pages", s.Pages},
+ {"Paginator pages", s.PaginatorPages},
+ {"Non-page files", s.Files},
+ {"Static files", s.Static},
+ {"Processed images", s.ProcessedImages},
+ {"Aliases", s.Aliases},
+ {"Sitemaps", s.Sitemaps},
+ {"Cleaned", s.Cleaned},
}
}
}
dirs := make([]string, len(mm))
i := 0
- for dir, _ := range mm {
+ for dir := range mm {
dirs[i] = dir
i++
}
// Run gofmt linter
func Fmt() error {
- if isGoTip() {
+ if !isGoLatest() {
return nil
}
pkgs, err := hugoPackages()
return nil
}
-func isGoTip() bool {
- return strings.Contains(runtime.Version(), "devel") || strings.Contains(runtime.Version(), "1.10")
+func isGoLatest() bool {
+ return strings.Contains(runtime.Version(), "1.10")
}
func (c *imageCache) deleteByPrefix(prefix string) {
c.mu.Lock()
defer c.mu.Unlock()
- for k, _ := range c.store {
+ for k := range c.store {
if strings.HasPrefix(k, prefix) {
delete(c.store, k)
}
image := fetchSunset(assert)
var meta = []map[string]interface{}{
- map[string]interface{}{
+ {
"title": "My Sunset",
"name": "Sunset #:counter",
"src": "*.jpg",
s := fmt.Sprintf("Cache entries: %d", len(r.imageCache.store))
count := 0
- for k, _ := range r.imageCache.store {
+ for k := range r.imageCache.store {
if count > 5 {
break
}
assertFunc func(err error)
}{
{[]map[string]interface{}{
- map[string]interface{}{
+ {
"title": "My Resource",
"name": "My Name",
"src": "*",
}},
{[]map[string]interface{}{
- map[string]interface{}{
+ {
"title": "My Logo",
"src": "*loGo*",
},
- map[string]interface{}{
+ {
"title": "My Resource",
"name": "My Name",
"src": "*",
}},
{[]map[string]interface{}{
- map[string]interface{}{
+ {
"title": "My Logo",
"src": "*loGo*",
"params": map[string]interface{}{
"icon": "logo",
},
},
- map[string]interface{}{
+ {
"title": "My Resource",
"src": "*",
"params": map[string]interface{}{
}},
{[]map[string]interface{}{
- map[string]interface{}{
+ {
"name": "Logo Name #:counter",
"src": "*logo*",
},
- map[string]interface{}{
+ {
"title": "Resource #:counter",
"name": "Name #:counter",
"src": "*",
}},
{[]map[string]interface{}{
- map[string]interface{}{
+ {
"title": "Third Logo #:counter",
"src": "logo3.png",
},
- map[string]interface{}{
+ {
"title": "Other Logo #:counter",
"name": "Name #:counter",
"src": "logo*",
}},
{[]map[string]interface{}{
- map[string]interface{}{
+ {
"title": "Third Logo",
"src": "logo3.png",
},
- map[string]interface{}{
+ {
"title": "Other Logo #:counter",
"name": "Name #:counter",
"src": "logo*",
}},
{[]map[string]interface{}{
- map[string]interface{}{
+ {
"name": "third-logo",
"src": "logo3.png",
},
- map[string]interface{}{
+ {
"title": "Logo #:counter",
"name": "Name #:counter",
"src": "logo*",
}},
{[]map[string]interface{}{
- map[string]interface{}{
+ {
"title": "Third Logo #:counter",
},
}, func(err error) {
}},
{[]map[string]interface{}{
- map[string]interface{}{
+ {
"title": "Title",
"src": "[]",
},
b.StopTimer()
var resources Resources
var meta = []map[string]interface{}{
- map[string]interface{}{
+ {
"title": "Foo #:counter",
"name": "Foo Name #:counter",
"src": "foo1*",
},
- map[string]interface{}{
+ {
"title": "Rest #:counter",
"name": "Rest Name #:counter",
"src": "*",