hi john,
other than php, go programs are compiled to an executable that can then
be run. you can not put go files in a folder and expect that to work.
you probably followed a tutorial to set up a go http server with a
simple route. the reason you get that idea that you can use file names
comes probably from the simple router mux of the http package that does
check only the prefix of the request path for you.
try just
http://localhost:8080 and you probably see the same form.
to have one program that includes the code of both files they need to be
part of the same package and must be compiled together.
from your description i gather that you probably ran "go run main2.go"
witch will only compile that one file into a program and run it.
instead you need to either list all the files of your main package
"go run main2.go main.go". or: go run is meant a convenience for mostly
single file programs, so instead most people use "go install" or "go
build" and execute the resulting program.
if both files are compiled into the same program they can have only one
main function. where you need to setup the http server and its routes.
there you can register the http handlers with path prefixes that you can
call from your html form.
hope that helps
if you need more detailed help please include the commands you ran and
a links to the code pasted somewhere; preferable the go playground.
> --
> 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
golang-nuts...@googlegroups.com
> <mailto:
golang-nuts...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/golang-nuts/8ae6812d-a551-429d-ab6b-5215063a60a2n%40googlegroups.com
> <
https://groups.google.com/d/msgid/golang-nuts/8ae6812d-a551-429d-ab6b-5215063a60a2n%40googlegroups.com?utm_medium=email&utm_source=footer>.