Skip to content

derpen/fastergoding

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fastergoding

A gopher tool for faster coding. It can automatically compile and rerun the main.main() function when the files is changed.

In this fork, fastergoding also detects if any html file is changed, instead of just detecting changes in go files. This is probably what you need if you are constantly editing a rendered html template.

Usage

cd {your-project}
go get -u github.com/derpen/fastergoding

then edit the main.go file

package main

import (
	"fmt"
	"log"
	"net/http"

	"github.com/derpen/fastergoding" // add this code
)

func main() {
	// Add this code
	fastergoding.Run() 
	
	// If your main.go is not in root folder, point to the folder from where you run go run
	// So, something like this
	fastergoding.Run("./cmd/api/main/")
	
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintf(w, "Hello %s!", r.URL.Query().Get("name"))
	})
	err := http.ListenAndServe(":8080", nil)
	if err != nil {
		log.Fatal("ListenAndServe: ", err)
	}
}

Develop

export GOPROXY=https://goproxy.cn #if you live in China
go get -u github.com/derpen/fastergoding

Reference

https://github.com/beego/bee

About

Go hot reload helper.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%