gofmt
parent
5c5fe0102b
commit
a3c30e0138
|
@ -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)
|
|
@ -7,7 +7,6 @@ import (
|
||||||
"github.com/hacdias/filemanager"
|
"github.com/hacdias/filemanager"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
var m *filemanager.FileManager
|
var m *filemanager.FileManager
|
||||||
|
|
||||||
func handler(w http.ResponseWriter, r *http.Request) {
|
func handler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@ -21,4 +20,4 @@ func main() {
|
||||||
m = filemanager.New()
|
m = filemanager.New()
|
||||||
http.HandleFunc("/", handler)
|
http.HandleFunc("/", handler)
|
||||||
http.ListenAndServe(":8080", nil)
|
http.ListenAndServe(":8080", nil)
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,43 +8,43 @@ type hasRuneTest struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var testHasRune = []hasRuneTest{
|
var testHasRune = []hasRuneTest{
|
||||||
hasRuneTest{
|
{
|
||||||
File: []byte(`---
|
File: []byte(`---
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||||
Sed auctor libero eget ante fermentum commodo.
|
Sed auctor libero eget ante fermentum commodo.
|
||||||
---`),
|
---`),
|
||||||
Return: true,
|
Return: true,
|
||||||
},
|
},
|
||||||
hasRuneTest{
|
{
|
||||||
File: []byte(`+++
|
File: []byte(`+++
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||||
Sed auctor libero eget ante fermentum commodo.
|
Sed auctor libero eget ante fermentum commodo.
|
||||||
+++`),
|
+++`),
|
||||||
Return: true,
|
Return: true,
|
||||||
},
|
},
|
||||||
hasRuneTest{
|
{
|
||||||
File: []byte(`{
|
File: []byte(`{
|
||||||
"json": "Lorem ipsum dolor sit amet"
|
"json": "Lorem ipsum dolor sit amet"
|
||||||
}`),
|
}`),
|
||||||
Return: true,
|
Return: true,
|
||||||
},
|
},
|
||||||
hasRuneTest{
|
{
|
||||||
File: []byte(`+`),
|
File: []byte(`+`),
|
||||||
Return: false,
|
Return: false,
|
||||||
},
|
},
|
||||||
hasRuneTest{
|
{
|
||||||
File: []byte(`++`),
|
File: []byte(`++`),
|
||||||
Return: false,
|
Return: false,
|
||||||
},
|
},
|
||||||
hasRuneTest{
|
{
|
||||||
File: []byte(`-`),
|
File: []byte(`-`),
|
||||||
Return: false,
|
Return: false,
|
||||||
},
|
},
|
||||||
hasRuneTest{
|
{
|
||||||
File: []byte(`--`),
|
File: []byte(`--`),
|
||||||
Return: false,
|
Return: false,
|
||||||
},
|
},
|
||||||
hasRuneTest{
|
{
|
||||||
File: []byte(`Lorem ipsum`),
|
File: []byte(`Lorem ipsum`),
|
||||||
Return: false,
|
Return: false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,14 +8,14 @@ type interfaceToBool struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var testIsMap = []*interfaceToBool{
|
var testIsMap = []*interfaceToBool{
|
||||||
&interfaceToBool{"teste", false},
|
{"teste", false},
|
||||||
&interfaceToBool{453478, false},
|
{453478, false},
|
||||||
&interfaceToBool{-984512, false},
|
{-984512, false},
|
||||||
&interfaceToBool{true, false},
|
{true, false},
|
||||||
&interfaceToBool{map[string]bool{}, true},
|
{map[string]bool{}, true},
|
||||||
&interfaceToBool{map[int]bool{}, true},
|
{map[int]bool{}, true},
|
||||||
&interfaceToBool{map[interface{}]bool{}, true},
|
{map[interface{}]bool{}, true},
|
||||||
&interfaceToBool{[]string{}, false},
|
{[]string{}, false},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIsMap(t *testing.T) {
|
func TestIsMap(t *testing.T) {
|
||||||
|
@ -27,17 +27,17 @@ func TestIsMap(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var testIsSlice = []*interfaceToBool{
|
var testIsSlice = []*interfaceToBool{
|
||||||
&interfaceToBool{"teste", false},
|
{"teste", false},
|
||||||
&interfaceToBool{453478, false},
|
{453478, false},
|
||||||
&interfaceToBool{-984512, false},
|
{-984512, false},
|
||||||
&interfaceToBool{true, false},
|
{true, false},
|
||||||
&interfaceToBool{map[string]bool{}, false},
|
{map[string]bool{}, false},
|
||||||
&interfaceToBool{map[int]bool{}, false},
|
{map[int]bool{}, false},
|
||||||
&interfaceToBool{map[interface{}]bool{}, false},
|
{map[interface{}]bool{}, false},
|
||||||
&interfaceToBool{[]string{}, true},
|
{[]string{}, true},
|
||||||
&interfaceToBool{[]int{}, true},
|
{[]int{}, true},
|
||||||
&interfaceToBool{[]bool{}, true},
|
{[]bool{}, true},
|
||||||
&interfaceToBool{[]interface{}{}, true},
|
{[]interface{}{}, true},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIsSlice(t *testing.T) {
|
func TestIsSlice(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue