Skip to content

Commit

Permalink
Apply go fmt to calc_entry.go
Browse files Browse the repository at this point in the history
  • Loading branch information
yamnikov-oleg committed Feb 4, 2017
1 parent 916ceeb commit 37db2c8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions calc_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"go/parser"
"math"
"strconv"
"strings"
"strings"
)

func PerformCalc(query string) LaunchEntriesList {
Expand Down Expand Up @@ -41,12 +41,12 @@ func EvaluateGoExpr(expr ast.Expr) (val float64, ok bool) {
return EvaluateGoCallExpr(expr.Fun, expr.Args)

case *ast.Ident:
val, ok := SupportedConstants[strings.ToLower(expr.String())]
val, ok := SupportedConstants[strings.ToLower(expr.String())]
return val, ok

case *ast.UnaryExpr:
case *ast.UnaryExpr:
// Only negation operator i supported
if expr.Op.String() != "-" {
if expr.Op.String() != "-" {
return 0, false
}
val, ok := EvaluateGoExpr(expr.X)
Expand Down Expand Up @@ -215,7 +215,7 @@ var SupportedCalcFuncs []CalcFunc = []CalcFunc{
{
[]string{"log"}, 2,
func(args ...float64) (float64, bool) {
return math.Log(args[1])/math.Log(args[0]), true
return math.Log(args[1]) / math.Log(args[0]), true
},
},
}
Expand Down

0 comments on commit 37db2c8

Please sign in to comment.