From b970bf5a2b2683e499967190a41807ed8d38aa13 Mon Sep 17 00:00:00 2001 From: David Landry Date: Fri, 5 Oct 2018 17:20:48 -0400 Subject: [PATCH] Fix unused-parameter errors --- pkg/compiler/listener.go | 2 +- pkg/compiler/visitor.go | 8 ++++---- pkg/runtime/expressions/literals/boolean.go | 2 +- pkg/runtime/expressions/literals/float.go | 2 +- pkg/runtime/expressions/literals/int.go | 2 +- pkg/runtime/expressions/literals/none.go | 2 +- pkg/runtime/expressions/literals/string.go | 2 +- pkg/runtime/expressions/operators/operator.go | 2 +- pkg/runtime/expressions/param.go | 2 +- pkg/runtime/expressions/variable.go | 2 +- pkg/stdlib/html/driver/dynamic/element.go | 2 +- pkg/stdlib/html/driver/static/static.go | 4 ++-- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkg/compiler/listener.go b/pkg/compiler/listener.go index dcb2b0de..92dda4dc 100644 --- a/pkg/compiler/listener.go +++ b/pkg/compiler/listener.go @@ -9,6 +9,6 @@ type errorListener struct { *antlr.DefaultErrorListener } -func (d *errorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException) { +func (d *errorListener) SyntaxError(_ antlr.Recognizer, _ interface{}, line, column int, msg string, _ antlr.RecognitionException) { panic(errors.Errorf("%s at %d:%d", msg, line, column)) } diff --git a/pkg/compiler/visitor.go b/pkg/compiler/visitor.go index 7be58ed7..12dab079 100644 --- a/pkg/compiler/visitor.go +++ b/pkg/compiler/visitor.go @@ -536,7 +536,7 @@ func (v *visitor) doVisitObjectLiteral(ctx *fql.ObjectLiteralContext, scope *sco return literals.NewObjectLiteralWith(props...), nil } -func (v *visitor) doVisitPropertyNameContext(ctx *fql.PropertyNameContext, scope *scope) (core.Expression, error) { +func (v *visitor) doVisitPropertyNameContext(ctx *fql.PropertyNameContext, _ *scope) (core.Expression, error) { return literals.NewStringLiteral(ctx.Identifier().GetText()), nil } @@ -611,7 +611,7 @@ func (v *visitor) doVisitBooleanLiteral(ctx *fql.BooleanLiteralContext) (core.Ex return literals.NewBooleanLiteral(strings.ToUpper(ctx.GetText()) == "TRUE"), nil } -func (v *visitor) doVisitNoneLiteral(ctx *fql.NoneLiteralContext) (core.Expression, error) { +func (v *visitor) doVisitNoneLiteral(_ *fql.NoneLiteralContext) (core.Expression, error) { return literals.None, nil } @@ -723,7 +723,7 @@ func (v *visitor) doVisitFunctionCallExpression(context *fql.FunctionCallExpress ) } -func (v *visitor) doVisitParamContext(context *fql.ParamContext, scope *scope) (collections.IterableExpression, error) { +func (v *visitor) doVisitParamContext(context *fql.ParamContext, _ *scope) (collections.IterableExpression, error) { name := context.Identifier().GetText() return expressions.NewParameterExpression( @@ -1012,7 +1012,7 @@ func (v *visitor) doVisitForTernaryExpression(ctx *fql.ForTernaryExpressionConte ) } -func (v *visitor) createTernaryOperator(src core.SourceMap, exps []core.Expression, scope *scope) (*expressions.ConditionExpression, error) { +func (v *visitor) createTernaryOperator(src core.SourceMap, exps []core.Expression, _ *scope) (*expressions.ConditionExpression, error) { var test core.Expression var consequent core.Expression var alternate core.Expression diff --git a/pkg/runtime/expressions/literals/boolean.go b/pkg/runtime/expressions/literals/boolean.go index 12fabe46..ec682060 100644 --- a/pkg/runtime/expressions/literals/boolean.go +++ b/pkg/runtime/expressions/literals/boolean.go @@ -12,7 +12,7 @@ func NewBooleanLiteral(val bool) BooleanLiteral { return BooleanLiteral(val) } -func (l BooleanLiteral) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) { +func (l BooleanLiteral) Exec(_ context.Context, _ *core.Scope) (core.Value, error) { if l == true { return values.True, nil } diff --git a/pkg/runtime/expressions/literals/float.go b/pkg/runtime/expressions/literals/float.go index f0eb0425..aa22730c 100644 --- a/pkg/runtime/expressions/literals/float.go +++ b/pkg/runtime/expressions/literals/float.go @@ -12,6 +12,6 @@ func NewFloatLiteral(value float64) FloatLiteral { return FloatLiteral(value) } -func (l FloatLiteral) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) { +func (l FloatLiteral) Exec(_ context.Context, _ *core.Scope) (core.Value, error) { return values.NewFloat(float64(l)), nil } diff --git a/pkg/runtime/expressions/literals/int.go b/pkg/runtime/expressions/literals/int.go index 6572847f..6ef43712 100644 --- a/pkg/runtime/expressions/literals/int.go +++ b/pkg/runtime/expressions/literals/int.go @@ -12,6 +12,6 @@ func NewIntLiteral(value int) IntLiteral { return IntLiteral(value) } -func (l IntLiteral) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) { +func (l IntLiteral) Exec(_ context.Context, _ *core.Scope) (core.Value, error) { return values.NewInt(int(l)), nil } diff --git a/pkg/runtime/expressions/literals/none.go b/pkg/runtime/expressions/literals/none.go index 261e332f..b224d832 100644 --- a/pkg/runtime/expressions/literals/none.go +++ b/pkg/runtime/expressions/literals/none.go @@ -10,6 +10,6 @@ type noneLiteral struct{} var None = &noneLiteral{} -func (l noneLiteral) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) { +func (l noneLiteral) Exec(_ context.Context, _ *core.Scope) (core.Value, error) { return values.None, nil } diff --git a/pkg/runtime/expressions/literals/string.go b/pkg/runtime/expressions/literals/string.go index 5c9df9c9..7a5b4a28 100644 --- a/pkg/runtime/expressions/literals/string.go +++ b/pkg/runtime/expressions/literals/string.go @@ -12,6 +12,6 @@ func NewStringLiteral(str string) StringLiteral { return StringLiteral(str) } -func (l StringLiteral) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) { +func (l StringLiteral) Exec(_ context.Context, _ *core.Scope) (core.Value, error) { return values.NewString(string(l)), nil } diff --git a/pkg/runtime/expressions/operators/operator.go b/pkg/runtime/expressions/operators/operator.go index 48405a74..812b37b7 100644 --- a/pkg/runtime/expressions/operators/operator.go +++ b/pkg/runtime/expressions/operators/operator.go @@ -14,7 +14,7 @@ type baseOperator struct { right core.Expression } -func (operator *baseOperator) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) { +func (operator *baseOperator) Exec(_ context.Context, _ *core.Scope) (core.Value, error) { return values.None, core.ErrInvalidOperation } diff --git a/pkg/runtime/expressions/param.go b/pkg/runtime/expressions/param.go index a2ee827d..bc7f9ca2 100644 --- a/pkg/runtime/expressions/param.go +++ b/pkg/runtime/expressions/param.go @@ -36,7 +36,7 @@ func (e *ParameterExpression) Iterate(ctx context.Context, scope *core.Scope) (c return iter, nil } -func (e *ParameterExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) { +func (e *ParameterExpression) Exec(ctx context.Context, _ *core.Scope) (core.Value, error) { param, err := core.ParamFrom(ctx, e.name) if err != nil { diff --git a/pkg/runtime/expressions/variable.go b/pkg/runtime/expressions/variable.go index 8ea2e1a1..931a3a7a 100644 --- a/pkg/runtime/expressions/variable.go +++ b/pkg/runtime/expressions/variable.go @@ -58,7 +58,7 @@ func (e *VariableExpression) Iterate(ctx context.Context, scope *core.Scope) (co return iter, nil } -func (e *VariableExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) { +func (e *VariableExpression) Exec(_ context.Context, scope *core.Scope) (core.Value, error) { return scope.GetVariable(e.name) } diff --git a/pkg/stdlib/html/driver/dynamic/element.go b/pkg/stdlib/html/driver/dynamic/element.go index 8ce2547c..e5a53a6b 100644 --- a/pkg/stdlib/html/driver/dynamic/element.go +++ b/pkg/stdlib/html/driver/dynamic/element.go @@ -458,7 +458,7 @@ func (el *HTMLElement) loadChildren() (core.Value, error) { return loaded, nil } -func (el *HTMLElement) handlePageReload(message interface{}) { +func (el *HTMLElement) handlePageReload(_ interface{}) { el.Close() } diff --git a/pkg/stdlib/html/driver/static/static.go b/pkg/stdlib/html/driver/static/static.go index 1f096c7f..209e331b 100644 --- a/pkg/stdlib/html/driver/static/static.go +++ b/pkg/stdlib/html/driver/static/static.go @@ -28,7 +28,7 @@ func NewDriver(setters ...Option) *Driver { return &Driver{client} } -func (d *Driver) GetDocument(ctx context.Context, url string) (values.HtmlNode, error) { +func (d *Driver) GetDocument(_ context.Context, url string) (values.HtmlNode, error) { req, err := httpx.NewRequest(httpx.MethodGet, url, nil) if err != nil { @@ -58,7 +58,7 @@ func (d *Driver) GetDocument(ctx context.Context, url string) (values.HtmlNode, return NewHtmlDocument(url, doc) } -func (d *Driver) ParseDocument(ctx context.Context, str string) (values.HtmlNode, error) { +func (d *Driver) ParseDocument(_ context.Context, str string) (values.HtmlNode, error) { buf := bytes.NewBuffer([]byte(str)) doc, err := goquery.NewDocumentFromReader(buf)