在golang中使用javascript响应网页

I have a webpage with login and password forms If login or password are wrong how could I response with javascript alert() or console.log() functions in golang

<body>
    <!-- LOGIN FORM -->
    <div class="login-page">
        <div class="form">
          <form class="login-form"action="/login" method="POST">
            <input type="text"   name="username"   placeholder="username"/>
            <input type="password" name="password" placeholder="password"/>
            <button type="submit" id="send" value="Login">Login</button>
          </form>
        </div>
      </div>
</body>

GOLANG

func (c *AuthenticationControllers) AdminLogin() http.HandlerFunc {
    return func(w http.ResponseWriter, r *http.Request) {

        switch r.Method {
        case "GET":
            http.ServeFile(w, r, "C:/Projects/Go/src/github.com/AlifElectronicQueue/web/template/login.html")
        case "POST":

            //********AUTHENTICATION PROCESS*********//
            if loginAns {
                //Some code
                http.Redirect(w, r, "/admin/applications", 302)

            }  else {
                http.Redirect(w, r, "/login", 302)
                http.Error(w, http.StatusText(http.StatusForbidden), http.StatusForbidden)
            }