Code cleanup
authorNoah Campbell <noahcampbell@gmail.com>
Wed, 2 Oct 2013 02:59:35 +0000 (19:59 -0700)
committerNoah Campbell <noahcampbell@gmail.com>
Tue, 8 Oct 2013 16:40:41 +0000 (18:40 +0200)
target/memory.go
transform/chain.go
transform/chain_test.go
transform/posttrans_test.go

index f8a3d91e893d979c0a221ed685a05b16a95e84c6..77437c1629e70e65faf957cb11cc4c29003981c5 100644 (file)
@@ -1,8 +1,8 @@
 package target
 
 import (
-       "io"
        "bytes"
+       "io"
 )
 
 type InMemoryTarget struct {
@@ -22,4 +22,3 @@ func (t *InMemoryTarget) Publish(label string, reader io.Reader) (err error) {
 func (t *InMemoryTarget) Translate(label string) (dest string, err error) {
        return label, nil
 }
-
index b9a865fe976ab1b6a181c853bb9a897adf04cb3b..1d50e8f2f236396f392846506c68c64030f1798a 100644 (file)
@@ -1,8 +1,8 @@
 package transform
 
 import (
-       "io"
        "bytes"
+       "io"
 )
 
 type chain struct {
@@ -23,7 +23,7 @@ func (c *chain) Apply(w io.Writer, r io.Reader) (err error) {
                }
                in = bytes.NewBuffer(out.Bytes())
        }
-       
+
        _, err = io.Copy(w, in)
        return
 }
index d122c31f8f43a220e158e6f414114bceb27ddd28..c7105cdad733a8066330e8c013c7cb0180206cab 100644 (file)
@@ -23,7 +23,7 @@ const H5_JS_CONTENT_ABS_URL_WITH_NAV = "<!DOCTYPE html><html><head><script src=\
 
 const CORRECT_OUTPUT_SRC_HREF_WITH_NAV = "<!DOCTYPE html><html><head><script src=\"http://two/foobar.js\"></script></head><body><nav><ul><li hugo-nav=\"section_0\"></li><li hugo-nav=\"section_1\" class=\"active\"></li></ul></nav><article>content <a href=\"http://two/foobar\">foobar</a>. Follow up</article></body></html>"
 
-var two_chain_tests = []test {
+var two_chain_tests = []test{
        {H5_JS_CONTENT_ABS_URL_WITH_NAV, CORRECT_OUTPUT_SRC_HREF_WITH_NAV},
 }
 
index 8ec004e8749a2fbb33a6f74448ad6a4772dd3a85..fd6bc18b2748b1b97aae1deee01d23927abe8245 100644 (file)
@@ -25,15 +25,15 @@ func TestAbsUrlify(t *testing.T) {
 }
 
 type test struct {
-       content string
+       content  string
        expected string
 }
 
-var abs_url_tests = []test {
-               {H5_JS_CONTENT_DOUBLE_QUOTE, CORRECT_OUTPUT_SRC_HREF},
-               {H5_JS_CONTENT_SINGLE_QUOTE, CORRECT_OUTPUT_SRC_HREF},
-               {H5_JS_CONTENT_ABS_URL, H5_JS_CONTENT_ABS_URL},
-       }
+var abs_url_tests = []test{
+       {H5_JS_CONTENT_DOUBLE_QUOTE, CORRECT_OUTPUT_SRC_HREF},
+       {H5_JS_CONTENT_SINGLE_QUOTE, CORRECT_OUTPUT_SRC_HREF},
+       {H5_JS_CONTENT_ABS_URL, H5_JS_CONTENT_ABS_URL},
+}
 
 func apply(t *testing.T, tr Transformer, tests []test) {
        for _, test := range tests {