summaryrefslogtreecommitdiff
path: root/Go Source Files.md
diff options
context:
space:
mode:
authorJasper Ras <jaspert.ras@gmail.com>2025-07-15 20:34:14 +0200
committerJasper Ras <jaspert.ras@gmail.com>2025-07-15 20:34:14 +0200
commit62483ddbc85da140b36eee2fa6bc43e7093eb3ad (patch)
tree33550a06020ec71e2777a6241447a40ba98c10ca /Go Source Files.md
parent04db4c941799bfbfac666160e7b4298716649a7f (diff)
parenta9886bf2f8a35369a2c42070c5f83504dfab2bc5 (diff)
vault backup: 2025-07-15 20:34:14
Diffstat (limited to 'Go Source Files.md')
-rw-r--r--Go Source Files.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/Go Source Files.md b/Go Source Files.md
new file mode 100644
index 0000000..cad6d6d
--- /dev/null
+++ b/Go Source Files.md
@@ -0,0 +1,17 @@
+[[Golang]]
+[[Go Packages]]
+
+---
+A source file has a specific structure.
+
+1. Package declaration
+2. Import declarations
+
+Only those two declarations above have a mandatory place in the source file. After the import declarations any other declaration may follow **in any order**.
+For example:
+* variable declarations
+- type definitions
+- function declarations
+
+# Todo (maybe split off)
+A function declaration : `func <name> (<param list>) (<result list>)`. No semicolons, unless multiple statements on 1 line. \ No newline at end of file