Fixed lint errors

This commit is contained in:
Ice3man543 2021-05-09 02:19:23 +05:30
parent f85a421550
commit 6c4495c0d1
2 changed files with 14 additions and 18 deletions

View File

@ -82,9 +82,9 @@ func New(options *Options) (*Client, error) {
configure = configure.MaxSize(options.CacheSize) configure = configure.MaxSize(options.CacheSize)
cache := ccache.New(configure) cache := ccache.New(configure)
interactionsConfig := ccache.Configure() interactionsCfg := ccache.Configure()
interactionsConfig = configure.MaxSize(defaultMaxInteractionsCount) interactionsCfg = interactionsCfg.MaxSize(defaultMaxInteractionsCount)
interactionsCache := ccache.New(interactionsConfig) interactionsCache := ccache.New(interactionsCfg)
interactClient := &Client{ interactClient := &Client{
interactsh: interactsh, interactsh: interactsh,
@ -105,11 +105,9 @@ func New(options *Options) (*Client, error) {
gotItem := interactClient.interactions.Get(interaction.UniqueID) gotItem := interactClient.interactions.Get(interaction.UniqueID)
if gotItem == nil { if gotItem == nil {
interactClient.interactions.Set(interaction.UniqueID, []*server.Interaction{interaction}, defaultInteractionDuration) interactClient.interactions.Set(interaction.UniqueID, []*server.Interaction{interaction}, defaultInteractionDuration)
} else { } else if items, ok := gotItem.Value().([]*server.Interaction); ok {
if items, ok := gotItem.Value().([]*server.Interaction); ok { items = append(items, interaction)
items = append(items, interaction) interactClient.interactions.Set(interaction.UniqueID, items, defaultInteractionDuration)
interactClient.interactions.Set(interaction.UniqueID, items, defaultInteractionDuration)
}
} }
return return
} }

View File

@ -169,16 +169,14 @@ func (r *Request) executeAddress(actualAddress, address, input string, shouldUse
} }
} }
callback(event) callback(event)
} else { } else if r.options.Interactsh != nil {
if r.options.Interactsh != nil { r.options.Interactsh.RequestEvent(interactURL, &interactsh.RequestData{
r.options.Interactsh.RequestEvent(interactURL, &interactsh.RequestData{ MakeResultFunc: r.MakeResultEvent,
MakeResultFunc: r.MakeResultEvent, Event: event,
Event: event, Operators: r.CompiledOperators,
Operators: r.CompiledOperators, MatchFunc: r.Match,
MatchFunc: r.Match, ExtractFunc: r.Extract,
ExtractFunc: r.Extract, })
})
}
} }
return nil return nil
} }