MCPcopy Index your code
hub / github.com/writefreely/writefreely / newVersionCheck

Function newVersionCheck

updates.go:115–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113}
114
115func newVersionCheck() (string, error) {
116 res, err := http.Get("https://version.writefreely.org")
117 if debugging {
118 log.Info("[update check] GET https://version.writefreely.org")
119 }
120 // TODO: return error if statusCode != OK
121 if err == nil && res.StatusCode == http.StatusOK {
122 defer res.Body.Close()
123
124 body, err := io.ReadAll(res.Body)
125 if err != nil {
126 return "", err
127 }
128 return string(body), nil
129 }
130 return "", err
131}

Callers 1

CheckNowMethod · 0.85

Calls 1

CloseMethod · 0.80

Tested by

no test coverage detected