From a3c30e013894ae4f8ea8faff06127055eef2c977 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sun, 25 Jun 2017 10:02:16 +0100 Subject: [PATCH] gofmt --- README.md | 4 ++++ cmd/filemanager/main.go | 3 +-- frontmatter/runes_test.go | 16 ++++++++-------- variables/types_test.go | 38 +++++++++++++++++++------------------- 4 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..f483904e --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# filemanager + +[![Build](https://img.shields.io/travis/hacdias/filemanager.svg?style=flat-square)](https://travis-ci.org/hacdias/filemanager) +[![Go Report Card](https://goreportcard.com/badge/github.com/hacdias/filemanager?style=flat-square)](https://goreportcard.com/report/hacdias/filemanager) diff --git a/cmd/filemanager/main.go b/cmd/filemanager/main.go index bb0f3407..f5ad1ac6 100644 --- a/cmd/filemanager/main.go +++ b/cmd/filemanager/main.go @@ -7,7 +7,6 @@ import ( "github.com/hacdias/filemanager" ) - var m *filemanager.FileManager func handler(w http.ResponseWriter, r *http.Request) { @@ -21,4 +20,4 @@ func main() { m = filemanager.New() http.HandleFunc("/", handler) http.ListenAndServe(":8080", nil) -} \ No newline at end of file +} diff --git a/frontmatter/runes_test.go b/frontmatter/runes_test.go index 6d120948..c8abc066 100644 --- a/frontmatter/runes_test.go +++ b/frontmatter/runes_test.go @@ -8,43 +8,43 @@ type hasRuneTest struct { } var testHasRune = []hasRuneTest{ - hasRuneTest{ + { File: []byte(`--- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor libero eget ante fermentum commodo. ---`), Return: true, }, - hasRuneTest{ + { File: []byte(`+++ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor libero eget ante fermentum commodo. +++`), Return: true, }, - hasRuneTest{ + { File: []byte(`{ "json": "Lorem ipsum dolor sit amet" }`), Return: true, }, - hasRuneTest{ + { File: []byte(`+`), Return: false, }, - hasRuneTest{ + { File: []byte(`++`), Return: false, }, - hasRuneTest{ + { File: []byte(`-`), Return: false, }, - hasRuneTest{ + { File: []byte(`--`), Return: false, }, - hasRuneTest{ + { File: []byte(`Lorem ipsum`), Return: false, }, diff --git a/variables/types_test.go b/variables/types_test.go index 9955b9b2..d2d5e37b 100644 --- a/variables/types_test.go +++ b/variables/types_test.go @@ -8,14 +8,14 @@ type interfaceToBool struct { } var testIsMap = []*interfaceToBool{ - &interfaceToBool{"teste", false}, - &interfaceToBool{453478, false}, - &interfaceToBool{-984512, false}, - &interfaceToBool{true, false}, - &interfaceToBool{map[string]bool{}, true}, - &interfaceToBool{map[int]bool{}, true}, - &interfaceToBool{map[interface{}]bool{}, true}, - &interfaceToBool{[]string{}, false}, + {"teste", false}, + {453478, false}, + {-984512, false}, + {true, false}, + {map[string]bool{}, true}, + {map[int]bool{}, true}, + {map[interface{}]bool{}, true}, + {[]string{}, false}, } func TestIsMap(t *testing.T) { @@ -27,17 +27,17 @@ func TestIsMap(t *testing.T) { } var testIsSlice = []*interfaceToBool{ - &interfaceToBool{"teste", false}, - &interfaceToBool{453478, false}, - &interfaceToBool{-984512, false}, - &interfaceToBool{true, false}, - &interfaceToBool{map[string]bool{}, false}, - &interfaceToBool{map[int]bool{}, false}, - &interfaceToBool{map[interface{}]bool{}, false}, - &interfaceToBool{[]string{}, true}, - &interfaceToBool{[]int{}, true}, - &interfaceToBool{[]bool{}, true}, - &interfaceToBool{[]interface{}{}, true}, + {"teste", false}, + {453478, false}, + {-984512, false}, + {true, false}, + {map[string]bool{}, false}, + {map[int]bool{}, false}, + {map[interface{}]bool{}, false}, + {[]string{}, true}, + {[]int{}, true}, + {[]bool{}, true}, + {[]interface{}{}, true}, } func TestIsSlice(t *testing.T) {