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