Just a Fake Quine for go ≥ 1.16

·

1 min read

What

A quine is a program that produces itself.

Go 1.16 add a new feature: embed, which makes the user can embed files into the program. Hence we can easily make a fake quine 🍺🍺🍺.

package main

import (
    _ "embed"
)

//go:embed main.go
var s string

func main() {
    print(s)
}