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: notification.go
    path of file: ./repos/apns2
    
    the code of the file until where you have to start completion: package apns2

import (
	"encoding/json"
	"time"
)

// EPushType defines the value for the apns-push-type header
type EPushType string

const (
	// PushTypeAlert is used for
    
func (n *Notification) MarshalJSON() ([]byte, error) {
	switch payload := n.Payload.(type) {
	case string:
		return []byte(payload), nil
	case []byte:
		return payload, nil
	default:
		return json.Marshal(payload)
	}
}