fastergoding

package module
v0.0.0-...-1e959d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

README

Fastergoding

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

Usage

package main

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

	"github.com/qinains/fastergoding"
)

func main() {
	fastergoding.Run() // Just add this code

	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

go get -u github.com/golang/dep/cmd/dep
dep ensure

Reference

https://github.com/beego/bee

Documentation

Overview

Package fastergoding provides a function to automatically compile and run go code. Example:

package main

import (

"fmt"
"log"
"net/http"

"github.com/qinains/fastergoding"

)

func main() {
	fastergoding.Run() //� �Just add this code

	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)
	}
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Run automatically compile and run the main function when the files is changed.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL