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

View File

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