Run separate folders in main folder in golang

I create two api service providers with Golang and run these api’s in the main.go file, whichever function is on top works. The sub function does not work. What should I do to get the two functions to work?

module gom

go 1.19


package main

import (




func main() {





package blog

func Blog(){



package email

func SendEmail(){


What does work mean?

What’s the implementation of the called functions?

how do i run two functions i need this

Your functions likely do not return. Run them asynchronously in new go routines.

go email.SendEmail()
// no go for the last function because the main goroutine will end the process will exit.

Again, what exactly do my mean with “only the first function works”?

And what would be the implementation of those functions?

Assuming both functions return, I would expect them to be called sequentially.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.