Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/js/libs/smb/memo.smbghost.go
2862 views
1
// Warning - This is generated code
2
package smb
3
4
import (
5
"errors"
6
7
"fmt"
8
9
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
10
)
11
12
func memoizeddetectSMBGhost(executionId string, host string, port int) (bool, error) {
13
hash := "detectSMBGhost" + ":" + fmt.Sprint(executionId) + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port)
14
15
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
16
return detectSMBGhost(executionId, host, port)
17
})
18
if err != nil {
19
return false, err
20
}
21
if value, ok := v.(bool); ok {
22
return value, nil
23
}
24
25
return false, errors.New("could not convert cached result")
26
}
27
28