commands, tpl: Get rid of repeating viper accesses

* all: Delete some blank lines
* commands, tpl: Get rid of repeating viper accesses
This commit is contained in:
Albert Nigmatzianov
2016-11-07 00:10:32 +01:00
committed by Bjørn Erik Pedersen
parent 4b4ab47553
commit 85a2d81e3c
9 changed files with 5 additions and 14 deletions

View File

@@ -42,7 +42,6 @@ func HasPygments() bool {
// Highlight takes some code and returns highlighted code.
func Highlight(code, lang, optsStr string) string {
if !HasPygments() {
jww.WARN.Println("Highlighting requires Pygments to be installed and in the path")
return code
@@ -197,7 +196,6 @@ func createOptionsString(options map[string]string) string {
}
func parseDefaultPygmentsOpts() (map[string]string, error) {
options := make(map[string]string)
err := parseOptions(options, viper.GetString("pygmentsOptions"))
if err != nil {
@@ -225,7 +223,6 @@ func parseDefaultPygmentsOpts() (map[string]string, error) {
}
func parsePygmentsOpts(in string) (string, error) {
options, err := parseDefaultPygmentsOpts()
if err != nil {
return "", err