summaryrefslogtreecommitdiff
path: root/Go Source Files.md
diff options
context:
space:
mode:
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