From a5facaed4fc1d1fbbae521f4398050d7abce2eee Mon Sep 17 00:00:00 2001 From: Jorropo Date: Tue, 29 Jul 2025 23:37:54 +0200 Subject: [PATCH] Simplify default.go (#7963) A while ago compiler explorer would only see exported functions of the main package (and the main function). I don't know when but at someone improved the flags passed to the go compiler and it now sees all functions, even if you use the oldest go compiler still supported. Remove noise from the example and make it more like the C one. --- examples/go/default.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/go/default.go b/examples/go/default.go index 3238bce7b..9f71fae42 100644 --- a/examples/go/default.go +++ b/examples/go/default.go @@ -1,9 +1,6 @@ // Type your code here, or load an example. -// Your function name should start with a capital letter. -package main +package p -func Square(x int) int { +func square(x int) int { return x * x } - -func main() {}