Skip to content

Commit

Permalink
modify tmd files
Browse files Browse the repository at this point in the history
  • Loading branch information
zigo101 committed Jul 4, 2024
1 parent 1dcd557 commit e71320d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pages/blog/2022-02-22-history.tmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## Update Histories of Go 101 Books
### Update Histories of Go 101 Books

* __Update history__ for __Go (Fundamentals) 101__
/////__Update history `` https://go101.org/article/100-updates.html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## Some Undocumented Changes in Go 1.18 and 1.19
### Some Undocumented Changes in Go 1.18 and 1.19

When a new Go version is released, the changes in this version are generally
listed the release notes of the version.
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/2022-10-01-three-way-string-comparison.tmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## No Safe Efficient Ways to Do Three-way String Comparisons in Go
### No Safe Efficient Ways to Do Three-way String Comparisons in Go

Three-way string comparison is widely used in programming (__proof 1__ and __proof 2__).
But up to now (Go 1.19), the __strings.Compare__ function in the standard library
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## It Is a Pity That Byte Elements of Go Constant Strings Are Not Constants. And It Is a Luck
### It Is a Pity That Byte Elements of Go Constant Strings Are Not Constants. And It Is a Luck

Does the following Go program compile okay?

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## Go Built-in Slice Manipulations Are Incomplete
### Go Built-in Slice Manipulations Are Incomplete

##========= Lack of a performant way to merge 3+ slices

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,9 @@ for Go source files:
+. Add a `//go:build go1.xy` comment directive at the start of
a source file to specify the language version for the source file.
%% (However, the `//go:build go1.xy` comment directive in a Go source file might
still be ignored due to __potential bugs__ in the toolchain implementation.)
still be ignored due to potential bugs in the toolchain implementation.
For example, the Go core team is not willing to fix __this known bug__ for
Go toolchain v1.22.x and v1.23.x versions.)
+. Use `-gcflags=-lang=go1.xy` compiler option when building a
Go binary to specify the Go language version for the seed files
you're passing to the compiler.
Expand All @@ -1081,6 +1083,7 @@ for Go source files:
The effects of the directive line are __described here__.

////__described here``https://go.dev/ref/mod#go-mod-file-go
////__this known bug``https://github.com/golang/go/issues/66092

If the Go language version of a Go source file is not specified by
any of the above ways, then the version of the used Go compiler is used.
Expand All @@ -1099,8 +1102,6 @@ The design causes two problems:
are not detected in time (due to insufficient testing, etc.),
then things may not go well.

////__potential bugs `` https://github.com/golang/go/issues/66092

Anyway, since Go 1.22, you should try to specify a Go language version for every Go source file,
in any of the above introduced ways, to avoid compiler version dependent behaviors.
This is the minimum standard to be a professional Go programmer in the Go 1.22+ era.
Expand Down

0 comments on commit e71320d

Please sign in to comment.