1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-08-13 19:52:52 +02:00

Fix unused-parameter errors

This commit is contained in:
David Landry
2018-10-05 17:20:48 -04:00
parent a4ce880d9c
commit b970bf5a2b
12 changed files with 16 additions and 16 deletions

View File

@@ -9,6 +9,6 @@ type errorListener struct {
*antlr.DefaultErrorListener *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)) panic(errors.Errorf("%s at %d:%d", msg, line, column))
} }

View File

@@ -536,7 +536,7 @@ func (v *visitor) doVisitObjectLiteral(ctx *fql.ObjectLiteralContext, scope *sco
return literals.NewObjectLiteralWith(props...), nil 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 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 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 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() name := context.Identifier().GetText()
return expressions.NewParameterExpression( 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 test core.Expression
var consequent core.Expression var consequent core.Expression
var alternate core.Expression var alternate core.Expression

View File

@@ -12,7 +12,7 @@ func NewBooleanLiteral(val bool) BooleanLiteral {
return BooleanLiteral(val) 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 { if l == true {
return values.True, nil return values.True, nil
} }

View File

@@ -12,6 +12,6 @@ func NewFloatLiteral(value float64) FloatLiteral {
return FloatLiteral(value) 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 return values.NewFloat(float64(l)), nil
} }

View File

@@ -12,6 +12,6 @@ func NewIntLiteral(value int) IntLiteral {
return IntLiteral(value) 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 return values.NewInt(int(l)), nil
} }

View File

@@ -10,6 +10,6 @@ type noneLiteral struct{}
var None = &noneLiteral{} 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 return values.None, nil
} }

View File

@@ -12,6 +12,6 @@ func NewStringLiteral(str string) StringLiteral {
return StringLiteral(str) 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 return values.NewString(string(l)), nil
} }

View File

@@ -14,7 +14,7 @@ type baseOperator struct {
right core.Expression 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 return values.None, core.ErrInvalidOperation
} }

View File

@@ -36,7 +36,7 @@ func (e *ParameterExpression) Iterate(ctx context.Context, scope *core.Scope) (c
return iter, nil 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) param, err := core.ParamFrom(ctx, e.name)
if err != nil { if err != nil {

View File

@@ -58,7 +58,7 @@ func (e *VariableExpression) Iterate(ctx context.Context, scope *core.Scope) (co
return iter, nil 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) return scope.GetVariable(e.name)
} }

View File

@@ -458,7 +458,7 @@ func (el *HTMLElement) loadChildren() (core.Value, error) {
return loaded, nil return loaded, nil
} }
func (el *HTMLElement) handlePageReload(message interface{}) { func (el *HTMLElement) handlePageReload(_ interface{}) {
el.Close() el.Close()
} }

View File

@@ -28,7 +28,7 @@ func NewDriver(setters ...Option) *Driver {
return &Driver{client} 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) req, err := httpx.NewRequest(httpx.MethodGet, url, nil)
if err != nil { if err != nil {
@@ -58,7 +58,7 @@ func (d *Driver) GetDocument(ctx context.Context, url string) (values.HtmlNode,
return NewHtmlDocument(url, doc) 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)) buf := bytes.NewBuffer([]byte(str))
doc, err := goquery.NewDocumentFromReader(buf) doc, err := goquery.NewDocumentFromReader(buf)