The Go Blog

Learn go from your browser.

Andrew Gerrand 4 October 2011

We are excited to announce A Tour of Go , a guided tour of the Go programming language you can run from your browser.

The tour is hands-on, demonstrating the language through code samples that you can modify, compile, and run from the tour itself. (The technology behind the Go Playground does the work.)

The tour has four sections. The first section covers basic syntax and data structures; the second discusses methods and interfaces; the third is about Generics; and the fourth introduces Go’s concurrency primitives. Each section concludes with a few exercises so you can practice what you’ve learned.

So, what are you waiting for? Get started now!

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

A Tour of Go is an introduction to the Go programming language. Visit https://tour.golang.org to start the tour.

Download/Install

To install the tour from source, first install Go and then run:

This will place a tour binary in your workspace 's bin directory. The tour program can be run offline.

Contributing

Contributions should follow the same procedure as for the Go project: https://golang.org/doc/contribute.html

To run the tour server locally:

Your browser should now open. If not, please visit http://localhost:3999/ .

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html .

The issue tracker for the tour's code is located at https://github.com/golang/go/issues . Prefix your issue with "x/tour:" in the subject line, so it is easy to find.

Issues with the tour's content itself should be reported in the issue tracker at https://github.com/golang/tour/issues .

Each time a CL is reviewed and submitted, the tour is automatically deployed to App Engine. If the CL is submitted with a Website-Publish +1 vote, the new deployment automatically becomes https://tour.golang.org/ . Otherwise, the new deployment can be found in the App Engine versions list and verified and manually promoted.

If the automatic deployment is not working, or to check on the status of a pending deployment, see the “website-redeploy-tour” trigger in the Cloud Build console .

Unless otherwise noted, the go-tour source files are distributed under the BSD-style license found in the LICENSE file.

Documentation ¶

There is no documentation for this package.

Source Files ¶

  • appengine.go

Keyboard shortcuts

Instantly share code, notes, and snippets.

@tetsuok

tetsuok / answer_word_count.go

  • Download ZIP
  • Star 11 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Embed Embed this gist in your website.
  • Share Copy sharable link for this gist.
  • Clone via HTTPS Clone using the web URL.
  • Learn more about clone URLs
  • Save tetsuok/2280069 to your computer and use it in GitHub Desktop.

@Tusharsb

Tusharsb commented Aug 23, 2018

Sorry, something went wrong.

@lealLuo

lealLuo commented Dec 2, 2018

I think mine is stupid but it works ...

@jhenriquez

jhenriquez commented Feb 11, 2019 • edited

@banothurameshnaik

banothurameshnaik commented Sep 20, 2019

@everbslab

everbslab commented Oct 12, 2019

@olehcambel

olehcambel commented Apr 17, 2020

@kaen98

kaen98 commented Apr 20, 2020 • edited

@Andrew-He

Andrew-He commented Apr 21, 2020

@denddyprod

denddyprod commented May 17, 2020 • edited

I had some problems with testing function wc.test so I tested it manually

@atyrian

atyrian commented Jun 14, 2020

package main

import ( "golang.org/x/tour/wc" "strings" )

func WordCount(s string) map[string]int { words := strings.Fields(s) m := make(map[string]int, len(words)) for _,v := range words{ m[v] += 1 } return m }

func main() { wc.Test(WordCount) }

@geekyarthurs

geekyarthurs commented Jun 22, 2020

@coderhh

coderhh commented Jun 25, 2020 • edited

Here is my answer:.

@Raghav2211

Raghav2211 commented Sep 7, 2020 • edited

@albertleng

albertleng commented Jan 9, 2021

@hefedev

hefedev commented Mar 5, 2021

@ichiro-ss

ichiro-ss commented Mar 12, 2021

Without "strings".

I'm a beginner so please give me some advice

@ramesh-km

ramesh-km commented Mar 28, 2021

@xfelmutx

xfelmutx commented Apr 2, 2021 • edited

@coderinblack08

coderinblack08 commented Apr 6, 2021

@DrCoffee84

DrCoffee84 commented May 14, 2021

without Split or Fields func

@DonkovtsevArthur

DonkovtsevArthur commented Nov 19, 2021 • edited

@laura-brizuela

laura-brizuela commented Nov 19, 2021 via email

@Devdha

Devdha commented Dec 14, 2021 • edited

@Rexoen

Rexoen commented Aug 7, 2022 • edited

@krapie

krapie commented Dec 7, 2022

@alkstsgv

alkstsgv commented Jun 19, 2023

@0riginaln0

0riginaln0 commented Aug 20, 2023

@sno-windy

sno-windy commented Oct 30, 2023

Here is my struggling answer without strings.Fields.

@poirierunited

poirierunited commented Nov 10, 2023

func WordCount(s string) map[string]int { counterMap := make(map[string]int)

@j4breu

j4breu commented Mar 13, 2024 • edited

  • Blogs by Topic

The GoLand Blog

A cross-platform Go IDE with extended support for JavaScript, TypeScript, and databases

  • Twitter Twitter
  • Youtube Youtube
  • slack slack

GoLand 2024.1 Is Out!

Ruslan Akhmetzianov

GoLand 2024.1 is out and comes with exciting new features like full line code completion for Go, a performance boost for indexing and code highlighting, major updates to remote development and dev containers, and support for some new Go 1.22 features.

Download GoLand 2024.1

In this blog post, we’ll take a quick tour through the most significant updates, but if you want to see the full list of improvements, check out What’s New in GoLand 2024.1 . Let’s dive in!

Full line code completion

GoLand 2024.1 introduces full line code completion, a new feature that autocompletes entire lines of code using locally-run, context-aware deep learning AI models. It helps improve coding speed and efficiency while working locally on your device and without sending any data to external servers. The feature comes bundled for every GoLand 2024.1 user. It’s the perfect way to get a taste of the AI experience! Read more in our dedicated blog post .

Performance improvements

Indexing is now significantly faster in GoLand, with speed gains of around 30% on average. Real-world results will vary for every user depending on the specifics of their projects and hardware. Feel free to share your results with us! Here is an illustration of indexing using the Gin framework:

Highlighting now works for references right from the IDE start-up! Take a look at these two examples:

Remote development 

GoLand 2024.1 provides an improved developer experience for remote scenarios – the highlighting, rendering, and overall smoothness of remote development are now close to what you experience with local programming. See how highlighting and completion in the cloud are almost as fast as they are for local codebases:

You can now manage remote projects directly from the IDE client, create new remote projects, and open existing ones.

Dev container support 

The IDE now has full support for dev containers and makes editing the devcontainer.json file easy. The following additional features have also been implemented:

  • You can now run a dev container (from your local disk or VCS) from the Welcome screen. Previously, it was necessary to open the project first.
  • Dev containers now come with file templates for all popular programming languages.
  • devcontainer.json files will be recognized no matter where they are stored in the project.

Support for Go 1.22 updates 

The Go language is constantly evolving, and we try to provide support for new language features as quickly as possible. 

Support for using range over integers and functions. Go 1.22 brings the ability to easily iterate over integers and functions in a way that is more concise than using a classic for loop.

golang tour of

Vendoring support for Go workspaces. Vendoring gives you more control over the dependencies used in your project by allowing you to store them in the project repository. In Go 1.22, commands in workspaces can use a vendor directory containing the workspace’s dependencies. GoLand now supports this improvement.

Leave your comments on this post, report any issues you encounter to our issue tracker , ping us on X (formerly Twitter ), or drop us a message in the Gophers Slack #goland channel.

Subscribe to GoLang Blog updates

By submitting this form, I agree that JetBrains s.r.o. ("JetBrains") may use my name, email address, and location data to send me newsletters, including commercial communications, and to process my personal data for this purpose. I agree that JetBrains may process said data using third-party services for this purpose in accordance with the JetBrains Privacy Policy . I understand that I can revoke this consent at any time in my profile . In addition, an unsubscribe link is included in each email.

Thanks, we've got you!

Discover more

GoLand data flow analysis

Data Flow Analysis for Go 

GoLand comes with support for data flow analysis (DFA). In this post, we’ll introduce the feature, explain how it works, and show some real-world examples of how DFA can detect bugs on the fly!

Ruslan Akhmetzianov

Goland 2024.1 Beta Is Out!

Get the Beta build via the Toolbox App, from our website, by using a snap package (for Ubuntu), or right from inside GoLand by selecting Check IDE updates for: Early Access Program in Settings | Appearance & Behavior | System Settings | Updates. Download GoLand 2024.1 Beta…

golang tour of

GoLand 2024.1: EAP Program and Roadmap

The Early Access Program for GoLand 2024.1 is now open! In this post, we’ll share our plans for the upcoming release and what has been done already in the first EAP build.

GoLand 2023.3 thumbnail

GoLand 2023.3 Is Available!

GoLand 2023.3 is out! It introduces full support for AI Assistant, early access for dev containers integration, as well as multiple Go-specific hints, refactorings, and quick-fixes to improve your productivity!

見出し画像

【入門】golangの学習方法 おすすめの教材、勉強方法を紹介

webdrawer

今回はGo言語/golangの学習を始める際の入門方法について解説していきます。

golang tour of

golangはGoogleが2009年にオープンソースのプロジェクトとして公開されたプログラミング言語です。そもそもはGoogle社の課題を解決するために開発された言語で、開発速度を向上させ、静的解析しやすい言語を目標として開発されました。 golangはメルカリやYouTubeなど、日頃使用している大規模なサービスにも採用されているため、実績は十分と言えます。 Goの主な特徴として、以下のようなものが挙げられます。

・初心者でも使いやすく学習コストが低い ・処理速度が速い ・並行処理が可能 ・標準ライブラリが豊富 ・シングルバイナリ ・クロスコンパイ

言語仕様の特徴としては、冗長な記述が不要であったり、曖昧な記述ができません。逆に言えば、シンプルに書けるのがメリットであるため、誰でもある程度は書きやすい言語ともいえます。

まずは公式ドキュメントを読み込んで理解を進めていきます。 Goの公式ウェブサイトにある ドキュメント やチュートリアルを読むことから始めます。 他にもGo言語の基本概念を理解するための対話式チュートリアルである 「 A Tour of Go 」 がおすすめです。

オンラインコースとビデオ

こUdemyなどのオンライン教育プラットフォームには、初心者向けのGo言語コースが豊富に用意されています。

【Go入門】Golang基礎入門 + 各種ライブラリ + 簡単なTodoWebアプリケーション開発(Go言語)

まだGo言語の勉強を始めていない方、全くの初心者の方にはこちらのUdemy教材が最もおすすめです。 この教材ではgolangの基礎について網羅的に学ぶことができます。ただ見て学ぶだけでなく、講座の中でアプリ作成まで行うことで学んだことの理解をさらに深めることができます。

現役シリコンバレーエンジニアが教えるGo入門 + 応用でビットコインのシストレFintechアプリの開発

個人的に最も勉強になったのは「現役シリコンバレーエンジニアが教えるGo入門 + 応用でビットコインのシストレFintechアプリの開発」という教材です。 本格的なレクチャーに入る前に、なぜGoなのか、なぜFintechなのかについて説明されていることで、Goの概念や意味について大枠から理解することができます。

以下の記事では筆者が実際に受講したおすすめUdemy教材をまとめています。

golang tour of

Go言語の入門から応用まではこの一冊で網羅されています。説明も順序立てて説明されており完成度の高い参考書となっています。

詳解Go言語Webアプリケーション開発

golang tour of

こちらはGo言語の基礎知識を得たあとに読むことをすすめる本となっています。ハンズオン形式で手を動かしながら実装をしていくことができるため、実際の開発を意識しながらGo言語を学ぶことができます。

以下の記事では他にも筆者が実際に読んでおすすめしたい本をまとめています。

コーディング練習と実践的なプロジェクト

基本を学んだ後は簡単なプログラムを自分で書いてみると良いでしょう。

詰まったらGitHubで他のプロジェクトを探って、 他の人が書いたGoのコードを読み、学びを深めましょう。

Go言語の学習には時間と実践が重要です。初心者向けのリソースから始めて徐々に複雑なトピックに進むことで、効率的かつ効果的にGo言語のスキルを身につけることができます。

※本ページではアフィリエイトリンク(PR)が含まれています。

この記事が参加している募集

  • #プログラミング初心者

この記事が気に入ったらサポートをしてみませんか?

IMAGES

  1. golang 4/5 Methods and FUnctions [A Tour of Go 1/26

    golang tour of

  2. Golang Tutorial #1

    golang tour of

  3. Introduction to Go (Golang)

    golang tour of

  4. 11 Solutions to Exercises in GoLang Tour

    golang tour of

  5. golang 배우기 5/5 번째 [A Tour of Go 1/11

    golang tour of

  6. 5 Reasons Why Golang is The Best Programming Language to Learn in 2021

    golang tour of

VIDEO

  1. GoLang #202

  2. INSTALLATION & EINRICHTUNG 🔹 Go / Golang Introduction 🔹 German Tutorial

  3. GoLang #203

  4. প্রোগ্রামিং শেখার আগে যে জিনিসগুলো জানতে হবে

  5. A Tour of Go #5: Финал

  6. A Tour of Go #4: Конкурируем

COMMENTS

  1. A Tour of Go

    Welcome to a tour of the Go programming language . The tour is divided into a list of modules that you can access by clicking on A Tour of Go on the top left of the page. You can also view the table of contents at any time by clicking on the menu on the top right of the page. Throughout the tour you will find a series of slides and exercises ...

  2. - The Go Programming Language

    3 4 The Go Authors 5 https://golang.org 6 7 * Hello, 世界 8 9 Welcome to a tour of the [[/][Go programming language]]. 10 11 The tour is divided into a list of modules that you can 12 access by clicking on 13 [[javascript:highlight(".logo")][A Tour of Go]] on the top left of the page.

  3. Learn Go from your browser

    4 October 2011. We are excited to announce A Tour of Go , a guided tour of the Go programming language you can run from your browser. The tour is hands-on, demonstrating the language through code samples that you can modify, compile, and run from the tour itself. (The technology behind the Go Playground does the work.) The tour has four sections.

  4. Go Tour

    Deploying. To deploy tour.golang.org, run: GO111MODULE=on gcloud --project=golang-org app deploy --no-promote app.yaml. This will create a new version, which can be viewed within the golang-org GCP project. Check that the deployed version looks OK (click the version link in GCP). If all is well, click "Migrate Traffic" to move 100% of the ...

  5. tour command

    Go Tour. A Tour of Go is an introduction to the Go programming language. Visit https://tour.golang.org to start the tour. Download/Install. To install the tour from ...

  6. Ultimate Go Tour

    Ultimate Go Tour. This is material for any intermediate-level developer who has some experience with other programming languages and wants to learn Go. We believe this material is perfect for anyone who wants a jump start in learning Go or who wants a more thorough understanding of the language and its internals.

  7. A Tour of Go Learning Go Programming Language

    This command build all files in package main into build file tour-golang, which is executable, you can run./tour-golang. Run package at runtime. go run *.go. This command is similar with build package and run the executable file. It will link files .go and run them. Notes with packages in Golang.

  8. GitHub

    [mirror] A Tour of Go. Contribute to golang/tour development by creating an account on GitHub.

  9. A Tour of Go

    Packages. Every Go program is made up of packages. Programs start running in package main . This program is using the packages with import paths "fmt" and "math/rand" . By convention, the package name is the same as the last element of the import path. For instance, the "math/rand" package comprises files that begin with the statement package ...

  10. A Tour of Go

    This allows goroutines to synchronize without explicit locks or condition variables. The example code sums the numbers in a slice, distributing the work between two goroutines. Once both goroutines have completed their computation, it calculates the final result. < 2/11 >. channels.go Syntax Imports. 23. 1.

  11. Learn Go This Week: A Language Built for Simplicity and Efficiency

    Free on JetBrains Marketplace. Access Tour of Go today by following these steps:. Download either GoLand (available with a 30-day free trial) or IntelliJ IDEA (choose the free community edition or a 30-day free trial).; Go to the Learn tab on the Welcome screen.; Check Enable access under Learn to Program.; From there you'll be able to find the course by locating it in the list of ...

  12. Tour of Go exercise #10: Crawler

    Exercise: Web Crawler. In this exercise you'll use Go's concurrency features to parallelize a web crawler. Modify the Crawl function to fetch URLs in parallel without fetching the same URL twice. Hint: you can keep a cache of the URLs that have been fetched on a map, but maps alone are not safe for concurrent use!

  13. Tour of Go exercise #18: Slices

    I am trying to complete the Exercise: Slices from the Go Tour. However I don't really understand what I'm being asked to do. Implement Pic. It should return a slice of length dy, each element of which is a slice of dx 8-bit unsigned integers.

  14. Tour of Go exercise #22: Reader, what does the question mean?

    1. You can generalize the idea to create an eternal reader, alwaysReader, from which you always read the same byte value over and over (it never results in EOF): package readers. type alwaysReader struct {. value byte. } func (r alwaysReader) Read(p []byte) (n int, err error) {. for i := range p {. p[i] = r.value.

  15. An answer of the exercise: Maps on a tour of Go · GitHub

    Fields ( s ) //instantiate wordcount map//where word will be the key, and count will be valuewordcount:=make ( map [ string] int ) //loop through each word in sentence..for_, element:=rangewords { // and increment the counter of that word by 1wordcount [ element] =wordcount [ element] +1 } returnwordcount } funcmain () { wc. Test ( WordCount ) }

  16. 11 Solutions to Exercises in GoLang Tour

    The Tour of Go Website is an excellent start for an developer trying to learn the language Go. It gradually introduces you to the language by explaining different parts and provides exercises to ...

  17. A Tour of Go

    Go Tour は複数の章で構成されています。 左上の A Tour of Go から辿ることができます。 また、目次は 右上の menu をクリックすることでいつでも参照できます。 Go Tour は、一連のスライドと演習課題(Exercise)で構成されています。 ページを切り替えるには:

  18. GoLand 2024.1 Is Out!

    April 4, 2024. GoLand 2024.1 is out and comes with exciting new features like full line code completion for Go, a performance boost for indexing and code highlighting, major updates to remote development and dev containers, and support for some new Go 1.22 features. Download GoLand 2024.1. In this blog post, we'll take a quick tour through ...

  19. Tour of Go exercise #23: rot13Reader

    There is change in every word. The problem is not that only the first word is read and decoded, the problem is in your decoding algorithm. In ROT13 if shifting goes outside of the letter range, you have to start from the beginning of the alphabet (or at the end). For example shifting 'N' would be 'Z' + 1, so it becomes 'A', the first letter.

  20. 【入門】golangの学習方法 おすすめの教材、勉強方法を紹介

    【Go入門】Golang基礎入門 + 各種ライブラリ + 簡単なTodoWebアプリケーション開発(Go言語) まだGo言語の勉強を始めていない方、全くの初心者の方にはこちらのUdemy教材が最もおすすめです。 この教材ではgolangの基礎について網羅的に学ぶことができます。

  21. A Tour of Go

    In Go, a name is exported if it begins with a capital letter. For example, Pizza is an exported name, as is Pi, which is exported from the math package. pizza and pi do not start with a capital letter, so they are not exported. When importing a package, you can refer only to its exported names. Any "unexported" names are not accessible from ...