On Thu, 22 Oct 2015 02:51:51 -0700 (PDT) "Hui Z." wrote:
I have a question about calling function from another package in go
There's no assemblies in Go -- that's a term from .NET.
In Go, there are packages and executables (programs) which are made of
packages: the package "main" which defines the program itself and
typically several external packages -- standard or 3rd-party.
Say, there are too packages at the top level, foo and bar.
There is this function hello() defined in foo.
I would like to call foo.bar() from within an assembly file in bar.
Is it possible to do it?
It's only possible to call the so-called exported package functions
outside of the package's code itself. The rule Go uses for exporting
anything is simple: every name which begins in a capital letter is
exported, all the others are not. So if you name your function Bar()
instear of bar(), if will become exported. Read  for more.
Please make sure you master at least minimal amount of introductory
material before attempting to program in an unknown language.
Really, this topic is extensively covered in any introductory course.
I'd start with  and then progressed to the "Effective Go" document
(available online). The articles in the official Go blog () are
And there's a good number of books, some of which are even freely
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/d/optout.