func instantShareEnabled() bool {
	log.Println("grab content, content-type of clipboard")
	cc, err := trayhost.GetClipboardContent()
	if err != nil {
		return false
	}
	switch {
	case len(cc.Files) == 1:  
		b, err := ioutil.ReadFile(cc.Files[0])
		if err != nil {
			return false
		}
		extension := strings.TrimPrefix(filepath.Ext(cc.Files[0]), ".")
		clipboard.extension = extension
		clipboard.bytes = b
		notificationThumbnail = fileThumbnail(extension, b)
		return true
	case cc.Image.Kind != "":
		clipboard.extension = string(cc.Image.Kind)
		clipboard.bytes = cc.Image.Bytes
		notificationThumbnail = cc.Image
		switch clipboard.extension {
		case "tiff":
			m, _, err := image.Decode(bytes.NewReader(clipboard.bytes))
			if err != nil {
				log.Panicln("image.Decode:", err)
			}
			var buf bytes.Buffer
			err = png.Encode(&buf, m)
			if err != nil {
				log.Panicln("png.Encode:", err)
			}
			clipboard.extension = "png"
			clipboard.bytes = buf.Bytes()
		}
		return true
	default:
		return false
	}
}
instantShareEnabled returns true if we have valid content in clipboard that can be instantly shared.
It also updates values of clipboard and notificationThumbnail if so.
package main
import (
	"bytes"
	"flag"
	"fmt"
	"image"
	"image/png"
	"io/ioutil"
	"log"
	"net/http"
	"path/filepath"
	"runtime"
	"strings"
	"time"
	"github.com/shurcooL/go/open"
	"github.com/shurcooL/trayhost"
	_ "golang.org/x/image/tiff"
)
var hostFlag = flag.String("host", "", "Target server host.")
var debugFlag = flag.Bool("debug", false, "Adds menu items for debugging purposes.")
var httpClient = &http.Client{Timeout: 3 * time.Second}
var clipboard struct {
	extension string  
	bytes     []byte
}
var notificationThumbnail trayhost.Image
func fileThumbnail(extension string, bytes []byte) trayhost.Image {
	switch extension {
	case "jpg", "jpeg":
		fallthrough
	case "png":
		return trayhost.Image{Kind: trayhost.ImageKind(extension), Bytes: bytes}
	default:
		return trayhost.Image{}
	}
}