Remove unused var
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 21 Jun 2015 20:57:42 +0000 (22:57 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 21 Jun 2015 20:57:42 +0000 (22:57 +0200)
hugolib/shortcode.go

index 69f712eb8ffe47839467c7ad9812e6fba85fad3c..630d17daff9b20fe78b7b4c66ed415e123fd1157 100644 (file)
@@ -461,7 +461,6 @@ func replaceShortcodeTokens(source []byte, prefix string, replacements map[strin
        var buff bytes.Buffer
 
        sourceLen := len(source)
-       width := 0
        start := 0
 
        pre := []byte("{@{@" + prefix)
@@ -492,16 +491,14 @@ func replaceShortcodeTokens(source []byte, prefix string, replacements map[strin
                }
 
                oldVal := source[j:end]
-               w, err := buff.Write(source[start:j])
+               _, err := buff.Write(source[start:j])
                if err != nil {
                        return nil, errors.New("buff write failed")
                }
-               width += w
-               w, err = buff.Write(newVal)
+               _, err = buff.Write(newVal)
                if err != nil {
                        return nil, errors.New("buff write failed")
                }
-               width += w
                start = j + len(oldVal)
 
                k = bytes.Index(source[start:], pre)