Anyone can write templates, which are packaged and distributed as modules, leveraging the Go module proxy and checksum database for better security and availability.Anyone can write templates, which are packaged and distributed as modules, leveraging the Go module proxy and checksum database for better security and availability.

Go Project Templates: How to Get Started

2025/09/21 00:00

When you start a new project in Go, you might begin by cloning an existing project. That way, you can start with something that already works, making incremental changes instead of starting from scratch.

\ For a long time now, we have heard from Go developers that getting started is often the hardest part. New developers coming from other languages expect guidance on a default project layout, experienced developers working on teams expect consistency in their projects’ dependencies, and developers of all kinds expect an easy way to try new products and services without having to copy and paste from samples on the web.

\ To that end, today we published gonew, an experimental tool for instantiating new projects in Go from predefined templates. Anyone can write templates, which are packaged and distributed as modules, leveraging the Go module proxy and checksum database for better security and availability.

\ The prototype gonew is intentionally minimal: what we have released today is an extremely limited prototype meant to provide a base from which we can gather feedback and community direction. Try it out, tell us what you think, and help us build a more useful tool for everyone.

Getting started

Start by installing gonew using go install:

$ go install golang.org/x/tools/cmd/gonew@latest 

\ To copy an existing template, run gonew in your new project’s parent directory with two arguments: first, the path to the template you wish to copy, and second, the module name of the project you are creating. For example:

$ gonew golang.org/x/example/helloserver example.com/myserver $ cd ./myserver 

\ And then you can read and edit the files in ./myserver to customize.

\ We’ve written two templates to get you started:

  • hello: A command line tool that prints a greeting, with customization flags.
  • helloserver: An HTTP server that serves greetings.

Write your own templates

Writing your own template is as easy as creating any other module in Go. Check out the examples we linked above to get started.

\ There are also examples available from the Google Cloud and Service Weaver teams.

Next steps

Please try out gonew and let us know how we can make it better and more useful. Remember, gonew is just an experiment for now; we need your feedback to get it right.


Cameron Balahan

\ This article is available on The Go Blog under a CC BY 4.0 DEED license.

\ Photo by Clemens van Lay on Unsplash

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

UK FCA Plans to Waive Some Rules for Crypto Companies: FT

UK FCA Plans to Waive Some Rules for Crypto Companies: FT

The post UK FCA Plans to Waive Some Rules for Crypto Companies: FT appeared on BitcoinEthereumNews.com. The U.K.’s Financial Conduct Authority (FCA) has plans to waive some of its rules for cryptocurrency companies, according to a Financial Times (FT) report on Wednesday. However, in another areas the FCA intends to tighten the rules where they pertain to industry-specific risks, such as cyber attacks. The financial watchdog wishes to adapt its existing rules for financial service companies to the unique nature of cryptoassets, the FT reported, citing a consultation paper published Wednesday. “You have to recognize that some of these things are very different,” David Geale, the FCA’s executive director for payments and digital finance, said in an interview, according to the report, adding that a “lift and drop” of existing traditional finance rules would not be effective with crypto. One such area that may be handled differently is the stipulation that a firm “must conduct its business with integrity” and “pay due regard to the interest of its customers and treat them fairly.” Crypto companies would be given less strict requirements than banks or investment platforms on rules concerning senior managers, systems and controls, as cryptocurrency firms “do not typically pose the same level of systemic risk,” the FCA said. Firms would also not have to offer customers a cooling off period due to the voltatile nature of crypto prices, nor would technology be classed as an outsourcing arrangement requiring extra risk management. This is because blockchain technology is often permissionless, meaning anyone can participate without the input of an intermediary. Other areas of crypto regulation remain undecided. The FCA has plans to fully integrate cryptocurrency into its regulatory framework from 2026. Source: https://www.coindesk.com/policy/2025/09/17/uk-fca-plans-to-waive-some-rules-for-crypto-companies-ft
Share
BitcoinEthereumNews2025/09/18 04:15
MoonBull, Toncoin & ETH Gains

MoonBull, Toncoin & ETH Gains

The post MoonBull, Toncoin & ETH Gains appeared on BitcoinEthereumNews.com. Crypto Presales MoonBull, Toncoin, and Ethereum are trending coins. Join MoonBull presale now, the best coins to buy in 2025 for early investor rewards! Have you ever wondered which altcoins could deliver massive gains in 2025? With cryptocurrencies evolving faster than ever, investors are hunting for coins that can outperform the market while offering early advantages. Toncoin and Ethereum have been making waves with adoption and ecosystem developments, drawing attention from traders and blockchain enthusiasts alike. Among the best coins to buy in 2025, MoonBull is turning heads with its active presale stage and massive upside potential. Stage 6 of the MoonBull presale is live, offering investors a rare first-come, first-served opportunity to secure tokens at the lowest prices. For those looking to jump into a trending coin that combines meme-coin energy with real-world utility, MoonBull offers a compelling option. MoonBull Presale Stage 6: Don’t Miss the Opportunity to Best Coins to Buy Now MoonBull ($MOBU), one of the best coins to buy in 2025, is setting the stage for a potential breakout, making it one of the most exciting coins in the market. With Stage 6 live at $0.00008388, early investors are positioned at the ground floor, securing tokens before demand surges across 23 stages. The presale tally has already surpassed $550K, and over 1,900 investors are holding $MOBU, creating significant buzz. Early participants have seen an ROI of 235.52%, while Stage 6 listing projects a jaw-dropping 7,244% potential. A $100 investment in Stage 6 of the MoonBull presale would secure approximately 1,192,179 tokens at the current price of $0.00008388 per token. If MoonBull reaches its estimated listing price of $0.00616, those tokens could be worth around $7,343.82 at launch. This potential transformation of a small investment into thousands of dollars underscores why MoonBull’s presale is attracting strong early…
Share
BitcoinEthereumNews2025/11/09 16:17