Go 1.8 or newer is required.
Due to imgview's dependency on gotk3, according to the installation instructions for gotk3, it currently requires GTK 3.6-3.22, GLib 2.36-2.40, and Cairo 1.10 or 1.12:
go get -u github.com/zenoda/imgview
package main
import (
"github.com/zenoda/imgview"
"image/jpeg"
"os"
)
func main() {
f, err := os.Open("pic.jpg")
if err != nil {
panic(err)
}
defer f.Close()
img, err := jpeg.Decode(f)
if err != nil {
panic(err)
}
imgview.Show(img)
}