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 set up a workspace and then run:

This will place a tour binary in your workspace's bin directory, which 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:

and then visit http://localhost:8080/ in your browser.

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 main issue tracker for the tour is located at https://github.com/golang/go/issues . Prefix your issue with "tour:" in the subject line, so it is easy to find.

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

Directories ¶

Keyboard shortcuts.

  • 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 go tour

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 go tour

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!

MarketSplash

How To Debug Golang For Effective Results

Debugging in Golang can be a maze, but with the right techniques and tools, it becomes a straightforward task. This guide offers insights and best practices to help you efficiently troubleshoot your Go code.

Debugging in Golang can sometimes feel like navigating a maze. Yet, with the right techniques and tools, pinpointing and resolving issues becomes a straightforward task. This guide offers insights and best practices to help you efficiently troubleshoot your Go code.

💡 KEY INSIGHTS

  • Delve is a popular Go debugger, offering a simple interface for exploring and troubleshooting code.
  • Understanding common errors like undefined variables, invalid type conversions, and index out of range is crucial for Go debugging.
  • Using print statements effectively can help in identifying logical errors that don't produce compiler errors.
  • Setting up a proper Go environment is essential for effective debugging, including installing Go and configuring necessary tools.

golang go tour

Setting Up Your Environment

Understanding the basics, common errors and solutions, using debugging tools, best practices, frequently asked questions.

Before diving into debugging, it's essential to have a conducive environment. This means having the right tools and configurations in place. Here's how to set up your Go environment for effective debugging.

Installing Go

Installing debugging tools, sample debugging session.

Ensure you have the latest version of Go installed. An updated version ensures you have access to the latest debugging features and fixes.

Delve is a debugger for the Go programming language. It provides a simple interface to explore your code.

Here's a simple example to demonstrate how to use Delve:

In your terminal, navigate to your program's directory and run:

When it comes to debugging in Go, it's crucial to understand the basics of how the language operates and the common errors that can occur. This knowledge will serve as your foundation for effective debugging.

Undefined Variable Or Function

Invalid type conversion, index out of range.

One common error is using an undefined variable or function . This occurs when you try to use a variable or function that hasn't been declared.

Another common error is invalid type conversion . This happens when you try to convert a variable from one type to another incompatible type.

An index out of range error occurs when you try to access an index of a slice or array that doesn't exist.

By understanding these common errors and their solutions, you'll be better equipped to troubleshoot your Go programs.

In Go, like any programming language, there are common errors that developers often encounter. Understanding these errors and knowing how to resolve them is key to efficient debugging.

Syntax Errors

Logical errors, runtime errors.

One of the first things to look out for is syntax errors . These are often the easiest to fix but can sometimes be overlooked. Go's compiler will usually point out syntax errors, making them easier to identify and correct.

Logical errors are more challenging to identify as they don't produce any compiler errors. These errors occur when the program runs but doesn't produce the expected output.

Runtime errors occur while the program is running and can cause it to crash. These errors can be due to a variety of reasons such as invalid input, file not found, etc.

By understanding these basic concepts and common errors, you'll be better equipped to debug your Go programs effectively.

Debugging tools are essential in identifying and fixing errors in your code. They provide a visual representation of what's happening in your program, making it easier to pinpoint where things are going wrong.

Delve Debugger

Print statements.

One of the most popular debugging tools for Go is Delve . It allows you to set breakpoints, step through your code, and inspect variables to understand how your program is executing.

Another simple yet effective debugging method is using print statements . By strategically placing print statements in your code, you can see the values of variables and the flow of execution.

By utilizing these debugging tools and methods, you'll be able to more effectively troubleshoot and fix issues in your Go programs.

When debugging in Go, following best practices can significantly enhance your efficiency and effectiveness in resolving issues.

Write Tests

Use linters and formatters.

One of the best practices is to write tests for your code. Tests help you verify that your code works as expected and can help identify where things are going wrong when they don't.

Another best practice is to use linters and formatters . These tools help you maintain a consistent coding style and can catch potential errors before they become a problem.

By following these best practices, you'll be better equipped to write clean, error-free code and effectively debug any issues that arise.

Are there any tools to automatically format and lint my Go code?

Yes, Go provides built-in tools like gofmt for formatting and golint for linting. These tools help maintain consistent coding standards and can catch potential issues early on.

How can I use print statements effectively for debugging?

Print statements can be strategically placed in your code to display the values of variables or the flow of execution. While they are a simple method, they can be very effective in understanding how your program is running, especially in the absence of a debugger.

Is it necessary to write tests for debugging?

While not strictly necessary for debugging, writing tests can help identify issues in your code. Tests allow you to verify that your code works as expected and can highlight areas where it doesn't, making it easier to pinpoint and resolve problems.

How can I handle runtime errors in Go?

Runtime errors occur while the program is running. To handle them, you can use Go's built-in error handling mechanisms, such as the error type and the defer , panic , and recover functions, to gracefully handle unexpected situations.

Let’s test your knowledge!

Which tool is specifically designed for debugging Go programs?

Continue learning with these golang guides.

  • How To Work With Golang Struct Efficiently
  • How To Work With Golang Template For Dynamic Text Output
  • How To Convert Golang Bool To String
  • How To Implement Golang Context Efficiently

Subscribe to our newsletter

Subscribe to be notified of new content on marketsplash..

Directory tour

IMAGES

  1. A Tour of Go #1: Вкатываемся в Golang, начинаем туториал

    golang go tour

  2. Golang Tutorial #1

    golang go tour

  3. The Benefits of Using the Go Programming Language (AKA Golang)

    golang go tour

  4. Go Tutorial (Golang) 1

    golang go tour

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

    golang go tour

  6. Go (Golang) Tutorial #1

    golang go tour

VIDEO

  1. ⚡️ОСЄЧКІН: унікальне відео з Крокуса ПОЯСНЮЄ ВСЕ! За день до бійні сталася ДИВНА подія

  2. Golang. Slices (Слайсы)

  3. GoLang #202

  4. #go #golang #برنامه_نویس

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

  6. Про порог входа в Golang

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. tour command

    The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go. Redistributable license Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.

  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. 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.

  6. Go 语言之旅

    欢迎来到 Go 编程语言指南。 点击页面左上角的 Go 指南可以访问本指南的模块列表。 你可以随时点击页面右上角的菜单来浏览内容列表。 本指南由一系列幻灯片贯穿始终,其中有一些练习需要你来完成。 你可以 按"上一页" 或 PageUp 键跳转到上一页,

  7. 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.

  8. 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 ...

  9. tip.golang.org

    The Go Authors https://golang.org * Hello, 世界 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 [[javascript:highlight(".logo")][A Tour of Go]] on the top left of the page.

  10. GitHub

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

  11. A Tour of Go Learning Go Programming Language

    Contribute to huynhsamha/tour-golang development by creating an account on GitHub. ... A Tour of Golang - First learning Go Programming Language. The tour of Golang. Go Playground - Online Editor. The Go Playground - Available for share. Notes when install and setup Go - IMPORTANTS.

  12. tour command

    The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go. Redistributable license Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.

  13. go

    i installed go for ubuntu as explained here https://golang.org/doc/install and here https://tour.golang.org/welcome/3 ("When you run the tour program, it will open a ...

  14. 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.

  15. 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 ...

  16. GitHub

    Contribute to atotto/go-tour-jp development by creating an account on GitHub. A Tour of Go 日本語版(PRお気軽にどうぞ). Contribute to atotto/go-tour-jp development by creating an account on GitHub. ... If all is well, click "Migrate Traffic" to move 100% of the tour.golang.org traffic to the new version. You're done. License.

  17. 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 ...

  18. How To Debug Golang For Effective Results

    Delve is a debugger for the Go programming language. It provides a simple interface to explore your code. // To install Delve: go get - u github. com /go- delve / delve / cmd / dlv. 📌. After installation, you can start the debugger using the dlv command followed by your program's name.

  19. - The Go Programming Language

    Learn and network with Go developers from around the world. ... Directory tour. File : Bytes../ basics/ concurrency/ flowcontrol/ generics/ methods/ moretypes/ solutions/ static/ template/ ... Connect Twitter GitHub Slack r/golang Meetup Golang Weekly Opens in new window.

  20. 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 ...