You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: message.go
    path of file: ./repos/eagle/pkg/flash
    
    the code of the file until where you have to start completion: package flash

// https://www.alexedwards.net/blog/simple-flash-messages-in-golang

import (
	"encoding/base64"
	"net/http"
	"time"

	"github.com/go-eagle/eagle/pkg/log"
)

var flashName = "flash"

// HasFlash check if have message
func HasFlash(r *http.Request
    
func GetMessage(w http.ResponseWriter, r *http.Request) ([]byte, error) {
	log.Info("[flash] begin get message...")
	c, err := r.Cookie(flashName)
	if err != nil {
		switch err {
		case http.ErrNoCookie:
			return nil, nil
		default:
			return nil, err
		}
	}

	// delete cookie
	dc := http.Cookie{
		Name:    flashName,
		Path:    "/",
		MaxAge:  -1,
		Expires: time.Unix(1, 0),
	}
	http.SetCookie(w, &dc)

	value, err := base64.URLEncoding.DecodeString(c.Value)
	if err != nil {
		return nil, err
	}

	return value, nil
}