Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Go

Idiom #127 Source code inclusion

Import the source code for the function foo body from a file "foobody.txt".

import _  "embed"
//go:embed foobody.txt
var s string

void foo()
{
#include "foobody.txt"
}

Same as C++

New implementation...
< >
MLKo