Create new Go projects (golang)

Build Status

Gonew V2

This is Gonew V2. It improves on Gonew Classic by providing a more flexible configuration and a vastly simpler code base. If you are migrating from Gonew Classic, see the migration guide (MIGRATION.md).

About gonew

Gonew is a tool for stubbing out new golang projects.

Documentation

Detailed usage and configuration information is on godoc.org.

Help out

If you want to add more licence templates or improve existing templates please create a new issue. I'm always open to ideas regarding template improvement. But be warned that I will scrutenize these ideas and reject some. The generality of Gonew's templating system allows users to create and use custom template sets. The guideline for altering Gonew's default templates is this:

Content generated by Gonew's default templates should follow all commonly accepted best-practices for their respective file types.

Any changes to gonew's templates should result in for greater adherence to this principle.

Author

Bryan Matsuo (bmatsuo)

Copyright & License

Copyright (c) 2011, Bryan Matsuo. All rights reserved.

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Comments
  • template.go:115: undefined: template.MustParseFile

    template.go:115: undefined: template.MustParseFile

    Hi, I am using latest weekly go release and like to try out gonew but it failed the compilation.

    [go@t-fedora15-64 gonew]$ pwd /home/go/go/src/pkg/github.com/bmatsuo/gonew [go@t-fedora15-64 gonew]$ make 6g -o go.6 config.go template.go repository.go hosts.go license.go file.go project.go gonew_main.go template.go:115: undefined: template.MustParseFile template.go:132: undefined: template.MustParseFile make: *** [go.6] Error 1 [go@t-fedora15-64 gonew]$

    [go@t-fedora15-64 gonew]$ hg id 6eb2b9dbe489 weekly/weekly.2011-08-17 [go@t-fedora15-64 gonew]$

  • Update dependency from missing repo

    Update dependency from missing repo

    Looks like @kless' goconfig repo disappeared. I found a fork, and things seem to build and behave OK on that fork.

    Let me know if I'm totally cracked here...I'm rather new to Go and it's world view.

  • gonew without argument should return help message

    gonew without argument should return help message

    Current

    [go@t-fedora15-64 ~]$ gonew missing TYPE argument [go@t-fedora15-64 ~]$

    Hope to see

    [go@t-fedora15-64 ~]$ gonew

    gonew [options] cmd NAME gonew [options] pkg NAME gonew [options] lib NAME PKG

    Usage of gonew: -debug=-1: Change the amout of debug output. -help=false: Show this message. -host="": Repository host if any (e.g. 'github'). -license="": Project license (e.g. 'newbsd'). -remote="": Remote repository url to initialize and push to. -repo="git": Repository type (e.g. 'git'). -target="": Makefile target. Default based on NAME. -test=true: Produce test files with Go files. -user="": Repo host username. -userepo=true: Create a local repository. -v=false: Verbose output. [go@t-fedora15-64 ~]$

  • .gonewrc not found warning

    .gonewrc not found warning

    Current

    [go@t-fedora15-64 go]$ gonew Enter your name: ^C [go@t-fedora15-64 go]$

    Hoping to see

    [go@t-fedora15-64 go]$ gonew ~/.gonewrc not found, initialize it now. Enter your name: [go@t-fedora15-64 go]$

  • Patch for fix fail on FindGonew()

    Patch for fix fail on FindGonew()

    After got gonew with go get, following error happened in FindGonew()

    error finding gonew source directory:
        stat $(GOROOT)/src/gonew: no such file or directory
    

    It happened bacause $(GOROOT)/src/github.com/bmatsuo/gonew not exists. In my case, go1.x in Ubuntu Linux, corrent path for gonew is;

    $(GOROOT)/src/pkg/github.com/bmatsuo/gonew
    

    Fixed FindGonew() to check exist of;

    • $(GOROOT)/src/pkg/github.com/bmatsuo/gonew
    • $(GOROOT)/src/github.com/bmatsuo/gonew
    • $(GOROOT)/src/gonew
  • Small change to .gitignore file

    Small change to .gitignore file

    I suggest a few changes to the .gitignore file that gonew creates, maybe it would be smart to add the following lines (or something close) to ignore backup files from text editors and temporary files from Vim

    *~*
    *.swp
    

    The first line may also work as *~ to allow for tilde in the filename, there may be others that may be good to add that I can not think of at the moment.

  • Errors out during install

    Errors out during install

    When trying to install gonew via the go install command it errors out with this

    # github.com/bmatsuo/gonew
    
    gocode/src/github.com/bmatsuo/gonew/config.go:101: undefined: os.ENOENT
    gocode/src/github.com/bmatsuo/gonew/config.go:104: undefined: os.ENOENT
    gocode/src/github.com/bmatsuo/gonew/gonew_main.go:144: undefined: os.ENOENT```
    
    I am using go version weekly.2012-02-22 +a28cc319fc47
    
    I can find `ENOENT` as a constant in the `syscall` package but not the `os` package.
    
  • Infer proper package names

    Infer proper package names

    Gonew should be smarter about package (target) names for "pkg" commands so that supplying the -target flag is unnecessary in most situations. Specifically, it should make the following assumptions:

    • Projects named "go-foo" should contain a package named "foo"
    • Projects named "bar.go" should contain a package named "bar"

    Nothing special should be done for projects named "gobaz". It seems to me the most common practice for projects with these names is for the package to be retain the "go" prefix.

  • Infer proper package names for libraries

    Infer proper package names for libraries

    The third argument for "lib" commands should be optional. Gonew should attempt to infer the package name from golang source files in the same directory. If there are no source files in the current directory, Gonew should default to package "main".

golang feature toggle library - a library to help make golang feature toggling clean and easy

toggle supports env_variable backed toggling. It can also be updated via a pubsub interface (tested w/ redis) 2 engines for toggle backing are include

Mar 29, 2022
go-watcher 是一款实现 Golang 源码热重启的工具

go-watcher 是一款实现 Golang 源码热重启的工具,可替换 go run 命令执行任意 main 入口程序,包括参数

Jan 7, 2022
Create new Go projects (golang)

Gonew V2 This is Gonew V2. It improves on Gonew Classic by providing a more flexible configuration and a vastly simpler code base. If you are migratin

Jul 29, 2020
Application open new tab in chrome when your favourite youtuber add new video.

youtube-opener This application open new tab in Chrome when your favourite youtuber add new video. It checks channel every one minute. How to run go r

Jan 16, 2022
Clones github projects into ~/Projects/github/{org}/{repo}

Tidy clone Github cli extension (gh extension) to clone repos into ~/Projects/github/{org}/{repo} on the local filesystem Install gh extension install

Jan 19, 2022
Create new commands from your shell history or terminal.

overdub Create new commands from your shell history or terminal. TODO list for initial release Filter out unlikely commands (e.g. package managers) fr

Aug 9, 2022
Create a new OpenAPI based blink-plugin

OpenAPI plugin template Create a new OpenAPI based blink-plugin. READ FIRST Getting the Repo Option 1: From Github Press Use this template Naming conv

Oct 14, 2021
✨ Create a new production-ready project with backend, frontend and deploy automation by running one CLI command!
✨ Create a new production-ready project with backend, frontend and deploy automation by running one CLI command!

✨ Create a new production-ready project with backend, frontend and deploy automation by running one CLI command!

Dec 31, 2022
A helper function to create a pointer to a new object in Go 1.18+
A helper function to create a pointer to a new object in Go 1.18+

A helper function to create a pointer to a new object in Go 1.18+

Nov 9, 2022
Traefik proxy plugin to extract HTTP header value and create a new header with extracted value

Copy header value Traefik plugin Traefik plugin that copies HTTP header value with format key1=value1; key2=value2 into a new header. Motivation for t

May 26, 2022
Package create provides a generic option pattern for creating new values of any type

create Package create provides a generic option pattern for creating new values

Dec 30, 2021
A new way to create web applications using go and sdf framework.

SDF GO A new way to create web applications using go and sdf framework Explore the docs » View Demo · Report Bug · Request Feature Table of Contents A

Sep 27, 2022
James is your butler and helps you to create, build, debug, test and run your Go projects
James is your butler and helps you to create, build, debug, test and run your Go projects

go-james James is your butler and helps you to create, build, debug, test and run your Go projects. When you often create new apps using Go, it quickl

Oct 8, 2022
Godzillacli - Create, Run Godzilla Projects Using Godzilla CLI

godzillacli Create, Run Godzilla Projects Using Godzilla CLI About: godzillacli

Jan 23, 2022
It is a clone of the CRUD operations on Instagram which can create, get, create posts and get the post along with pagination
It is a clone of the CRUD operations on Instagram which can create, get, create posts and get the post along with pagination

Instagram-API-Clone It is a basic version of a RESTful API based on Instagram where we can create user, get the users, create post and get post and ge

Jan 25, 2022
Node is where client will send data to, create block send to miner, create block send to parent and receive tick from validator and do validate

Node Receive Tick from validator Validate POH of tick send result to validator Receive confirm block from validator Send Checked block to validator Ho

Dec 31, 2021
A template for creating new Golang + Docker + Canonical Domain + Badges + Renovate + Golangci + Goreleaser + CircleCI + ...
A template for creating new Golang + Docker + Canonical Domain + Badges + Renovate + Golangci + Goreleaser + CircleCI + ...

golang-repo-template ?? golang-repo-template Usage foo@bar:~$ golang-repo-template hello world _

Dec 29, 2022
Check for new github releases of your Golang application 🎊

whatsnew Check for new github releases of your Golang application ?? whatsnew provides a simple way to check GitHub for new releases of your Go applic

Dec 1, 2021
New World Auction House Crawler In Golang

New-World-Auction-House-Crawler Goal of this library is to have a process which grabs New World auction house data in the background while playing the

Sep 7, 2022
Stackledger: a new blockchain written in golang

StackLedger Stackledger is a new blockchain. It is written in golang and uses a novel networking stack built from two primitives: channels and extensi

Feb 21, 2022