MCPcopy Create free account
hub / github.com/dumorewithcode/purl / getCookieFromFile

Function getCookieFromFile

main.go:67–85  ·  view source on GitHub ↗
(file string)

Source from the content-addressed store, hash-verified

65}
66
67func getCookieFromFile(file string) string {
68 cookie := ""
69
70 if file != "" {
71 f, err := os.Open(file)
72 if err != nil {
73 fmt.Fprintf(os.Stderr, "%s\n", err)
74 os.Exit(1)
75 }
76 defer f.Close()
77
78 value, err := ioutil.ReadAll(f)
79 if err != nil {
80 fmt.Fprintf(os.Stderr, "%s\n", err)
81 }
82 cookie = string(value)
83 }
84 return cookie
85}
86
87func (r requestData) makeRequest(url string) {
88 req, err := http.NewRequest("GET", url, nil)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected