Skip to main content

Just a Fake Quine for go ≥ 1.16

Updated 1 min readMarkdown

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)
}

About the author

  • 後端工程師。 不定時張貼一些寫扣時的筆記,有時英文,有時中文。 「如果,我是魔女的話...」

No comments yet. Be the first to comment.

More from this blog