<@816758878980276224> Last time when working on th...
# development
d
@bored-island-21407 Last time when working on the Jenkins go test, do found this: fmt.Fprintln arg list ends with redundant newline I just reading the code, actually the const already has a newline, and Fprintln created another new line.
Copy code
go
// == define error HTML here ==
const oauthNotConfigured = `<!DOCTYPE html><html>
<body>
<h3>Your Netmaker server does not have OAuth configured.</h3>
<p>Please visit the docs <a href="https://docs.netmaker.org/oauth.html" target="_blank" rel="noopener">here</a> to learn how to.</p>
</body>
</html>
`

// HandleAuthCallback - handles oauth callback
func HandleAuthCallback(w http.ResponseWriter, r *http.Request) {
    if auth_provider == nil {
        w.Header().Set("Content-Type", "text/html; charset=utf-8")
        fmt.Fprintln(w, oauthNotConfigured)
        return
    }
The fix can be:
Copy code
go
// == define error HTML here ==
const oauthNotConfigured = `<!DOCTYPE html><html>
<body>
<h3>Your Netmaker server does not have OAuth configured.</h3>
<p>Please visit the docs <a href="https://docs.netmaker.org/oauth.html" target="_blank" rel="noopener">here</a> to learn how to.</p>
</body>
</html>`
Let me know if you guys want to fix this 🙂 I think totally two places has this issue, if fix it then no complain in any CI/CD with go test.
3 Views