Project run problem

error
package command-line-arguments
imports GitHub - gorilla/mux: A powerful HTTP router and URL matcher for building Go web servers with 🦍
imports github.com/gorilla/mux: import cycle not allowed

routes.go

package main

import (
	"log"

	"github.com/gorilla/mux"
)

func AddApproutes(route *mux.Router) {

	log.Println("Loadeding Routes...")

	route.HandleFunc("/", RenderHome)

	route.HandleFunc("/sendEmail", SendEmailHandler).Methods("POST")

	log.Println("Routes are Loaded.")
}

server.go

package main

import (
	"log"
	"net/http"

	"github.com/gorilla/mux"
)

func main() {

	log.Println("Server will start at http://localhost:8000/")

	route := mux.NewRouter()

	AddApproutes(route)

	log.Fatal(http.ListenAndServe(":8000", route))
}

What is your module name?

.module GitHub - gorilla/mux: A powerful HTTP router and URL matcher for building Go web servers with 🦍.

go 1.19

You should give your module a name that you control, and not copy the name that mux is already using

1 Like

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