GithubHelp home page GithubHelp logo

azer / go-makefile-example Goto Github PK

View Code? Open in Web Editor NEW
263.0 9.0 39.0 11 KB

Example Makefile for Go projects

Home Page: https://kodfabrik.com/journal/a-good-makefile-for-go/

License: Do What The F*ck You Want To Public License

Makefile 85.66% Go 14.34%

go-makefile-example's Introduction

go-makefile-example

Example project for the Makefile explained in A Good Makefile for Go blog post.

Setup

Run following commands to try it out:

It should now be running at :7777 (defined in .env file). You can try making a change and see how the server will get recompiled and restarted automatically.

Manual

Run make help to list available commands:

  λ  make help

 Choose a command run in go-makefile-example:

  install   Install missing dependencies. Runs `go get` internally. e.g; make install get=github.com/foo/bar
  start     Start in development mode. Auto-starts when code changes.
  stop      Stop development mode.
  watch     Run given command when code changes. e.g; make watch run="echo 'hey'"
  compile   Compile the binary.
  exec      Run given command, wrapped with custom GOPATH. e.g; make exec run="go test ./..."
  clean     Clean build files. Runs `go clean` internally.

go-makefile-example's People

Contributors

luisdavim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-makefile-example's Issues

No licence

This makefile is really super cool, but there's no licence associated with this project which legally means the default "all rights reserved" applies. (See GitHub licensing help pages for more info.)

If you could add an open source licence like MIT (or whichever), that would allow those of us working in places with policies about licensing to use it.

Installation failed

Not able to install on Ubuntu 16.04:

$ git clone https://github.com/azer/go-makefile-example.git
$ cd go-makefile-example
$ go get github.com/azer/yolo
package context: unrecognized import path "context" (import path does not begin with hostname)
package net/http/httptrace: unrecognized import path "net/http/httptrace" (import path does not begin with hostname)

Print kills the hot reload

Hi there,
Not sure if this is still maintained, but if yes, here is a bug that I cannot understand in your example:
If you add a fmt.Println("someText") in the main, the hot reload will silently fail. It seems that the binary is not run by yolo

func main() {
    fmt.Println("OK1")
    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintf(w, "message2")
    })

    http.ListenAndServe(":8080", nil)
}

I'd be glad to help if you have any idea why

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.