diff options
| author | Russ Cox <rsc@golang.org> | 2021-11-18 10:51:11 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-11-22 16:43:17 +0000 |
| commit | 61fc64f2024b3366363d7c623862d0ab6542a1ff (patch) | |
| tree | b8a1ed915d58d6cc6420d9e8c3a0a23051ebe76d /_content/doc/tutorial | |
| parent | 9d77df7a831fbde9ba62c77c9cd5dc3dd6f6a1c7 (diff) | |
| download | go-x-website-61fc64f2024b3366363d7c623862d0ab6542a1ff.tar.xz | |
_content: update links to tour
Now the tour is just /tour, not https://tour.golang.org.
Change-Id: Iebb2f7a5218b747896250815f4f46f62755e6a88
Reviewed-on: https://go-review.googlesource.com/c/website/+/365101
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Diffstat (limited to '_content/doc/tutorial')
| -rw-r--r-- | _content/doc/tutorial/create-module.html | 4 | ||||
| -rw-r--r-- | _content/doc/tutorial/database-access.md | 24 | ||||
| -rw-r--r-- | _content/doc/tutorial/index.html | 2 | ||||
| -rw-r--r-- | _content/doc/tutorial/module-conclusion.html | 2 | ||||
| -rw-r--r-- | _content/doc/tutorial/web-service-gin.md | 12 |
5 files changed, 22 insertions, 22 deletions
diff --git a/_content/doc/tutorial/create-module.html b/_content/doc/tutorial/create-module.html index d187f4f9..903a3da6 100644 --- a/_content/doc/tutorial/create-module.html +++ b/_content/doc/tutorial/create-module.html @@ -217,8 +217,8 @@ func Hello(name string) string { <code>string</code>. The function also returns a <code>string</code>. In Go, a function whose name starts with a capital letter can be called by a function not in the same package. This is known in Go as - an exported name. For more about exported names, see - <a href="https://tour.golang.org/basics/3">Exported names</a> in the + an exported name. For more about exported names, see + <a href="/tour/basics/3">Exported names</a> in the Go tour. </p> <img src="images/function-syntax.png" width="300px" /> diff --git a/_content/doc/tutorial/database-access.md b/_content/doc/tutorial/database-access.md index cdb62127..cd0cfb8f 100644 --- a/_content/doc/tutorial/database-access.md +++ b/_content/doc/tutorial/database-access.md @@ -111,7 +111,7 @@ but most DBMSes have their own CLI with similar features. $ mysql -u root -p Enter password: - mysql> + mysql> ``` 3. At the `mysql` command prompt, create a database. @@ -141,9 +141,9 @@ but most DBMSes have their own CLI with similar features. PRIMARY KEY (`id`) ); - INSERT INTO album - (title, artist, price) - VALUES + INSERT INTO album + (title, artist, price) + VALUES ('Blue Train', 'John Coltrane', 56.99), ('Giant Steps', 'John Coltrane', 63.99), ('Jeru', 'Gerry Mulligan', 17.99), @@ -155,10 +155,10 @@ but most DBMSes have their own CLI with similar features. * Delete (drop) a table called `album`. Executing this command first makes it easier for you to re-run the script later if you want to start over with the table. - + * Create an `album` table with four columns: `title`, `artist`, and `price`. Each row's `id` value is created automatically by the DBMS. - + * Add three rows with values. 7. From the `mysql` command prompt, run the script you just created. @@ -228,7 +228,7 @@ With the driver imported, you'll start writing code to access the database. Now write some Go code that gives you database access with a database handle. You'll use a pointer to an `sql.DB` struct, which represents access to a -specific database. +specific database. #### Write the code @@ -271,7 +271,7 @@ specific database. production, you'd avoid the global variable, such as by passing the variable to functions that need it or by wrapping it in a struct. - * Use the MySQL driver's [`Config`](https://pkg.go.dev/github.com/go-sql-driver/mysql#Config) + * Use the MySQL driver's [`Config`](https://pkg.go.dev/github.com/go-sql-driver/mysql#Config) -- and the type's [`FormatDSN`](https://pkg.go.dev/github.com/go-sql-driver/mysql#Config.FormatDSN) -– to collect connection properties and format them into a DSN for a connection string. @@ -294,7 +294,7 @@ specific database. `sql.Open` might not immediately connect, depending on the driver. You're using `Ping` here to confirm that the `database/sql` package can connect when it needs to. - + * Check for an error from `Ping`, in case the connection failed. * Print a message if `Ping` connects successfully. @@ -473,7 +473,7 @@ learn how to query for a single row later, in the section * Call the `albumsByArtist` function you added, assigning its return value to a new `albums` variable. - + * Print the result. #### Run the code @@ -520,7 +520,7 @@ For SQL statements you know will return at most a single row, you can use * Use [`DB.QueryRow`](https://pkg.go.dev/database/sql#DB.QueryRow) to execute a `SELECT` statement to query for an album with the - specified ID. + specified ID. It returns an `sql.Row`. To simplify the calling code (your code!), `QueryRow` doesn't return an error. Instead, @@ -659,7 +659,7 @@ Suggested next topics: * If you're new to Go, you'll find useful best practices described in [Effective Go](/doc/effective_go) and [How to write Go code](/doc/code). -* The [Go Tour](https://tour.golang.org/welcome/1) is a great step-by-step +* The [Go Tour](/tour/) is a great step-by-step introduction to Go fundamentals. ## Completed code {#completed_code} diff --git a/_content/doc/tutorial/index.html b/_content/doc/tutorial/index.html index 31abf8b4..c7eb82da 100644 --- a/_content/doc/tutorial/index.html +++ b/_content/doc/tutorial/index.html @@ -50,7 +50,7 @@ </tr> <tr class="DocTable-row"> <td class="DocTable-cell"> - <a href="https://tour.golang.org/welcome/1">A Tour of Go</a> + <a href="/tour/">A Tour of Go</a> </td> <td class="DocTable-cell"> An interactive introduction to Go: basic syntax and data structures; diff --git a/_content/doc/tutorial/module-conclusion.html b/_content/doc/tutorial/module-conclusion.html index f86af3af..dbd71eb8 100644 --- a/_content/doc/tutorial/module-conclusion.html +++ b/_content/doc/tutorial/module-conclusion.html @@ -21,7 +21,7 @@ </p> <p>For many more features of the Go language, check out the - <a href="https://tour.golang.org/welcome/1">Tour of Go</a>. + <a href="/tour/">Tour of Go</a>. </p> <p class="Navigation"> diff --git a/_content/doc/tutorial/web-service-gin.md b/_content/doc/tutorial/web-service-gin.md index 934c7d42..88b36e2d 100644 --- a/_content/doc/tutorial/web-service-gin.md +++ b/_content/doc/tutorial/web-service-gin.md @@ -156,14 +156,14 @@ time you stop the server, then recreated when you start it. {ID: "2", Title: "Jeru", Artist: "Gerry Mulligan", Price: 17.99}, {ID: "3", Title: "Sarah Vaughan and Clifford Brown", Artist: "Sarah Vaughan", Price: 39.99}, } - ``` + ``` Next, you'll write code to implement your first endpoint. ## Write a handler to return all items {#all_items} When the client makes a request at `GET /albums`, you want to return all the -albums as JSON. +albums as JSON. To do this, you'll write the following: @@ -193,7 +193,7 @@ adding dependencies first, then the code that depends on them. * Write a `getAlbums` function that takes a [`gin.Context`](https://pkg.go.dev/github.com/gin-gonic/gin#Context) parameter. Note that you could have given this function any name – neither - Gin nor Go require a particular function name format. + Gin nor Go require a particular function name format. `gin.Context` is the most important part of Gin. It carries request details, validates and serializes JSON, and more. (Despite the similar @@ -293,7 +293,7 @@ adding dependencies first, then the code that depends on them. $ curl http://localhost:8080/albums ``` - The command should display the data you seeded the service with. + The command should display the data you seeded the service with. ``` [ @@ -432,7 +432,7 @@ To do this, you'll write the following: --request "GET" ``` - The command should display the album list. + The command should display the album list. ``` [ @@ -577,7 +577,7 @@ Suggested next topics: * If you're new to Go, you'll find useful best practices described in [Effective Go](/doc/effective_go) and [How to write Go code](/doc/code). -* The [Go Tour](https://tour.golang.org/welcome/1) is a great step-by-step +* The [Go Tour](/tour/) is a great step-by-step introduction to Go fundamentals. * For more about Gin, see the [Gin Web Framework package documentation](https://pkg.go.dev/github.com/gin-gonic/gin) or the [Gin Web Framework docs](https://gin-gonic.com/docs/). |
