all: update go directive to 1.18

Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.2.

Change-Id: Iab993489d7393a961c136a6f63279ca6bb7defce
Reviewed-on: https://go-review.googlesource.com/c/debug/+/533697
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/cmd/viewcore/html.go b/cmd/viewcore/html.go
index 0ec01b0..58c7824 100644
--- a/cmd/viewcore/html.go
+++ b/cmd/viewcore/html.go
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build !aix && !plan9 && !wasm
-// +build !aix,!plan9,!wasm
 
 // (go.dev/issue/32839)
 
diff --git a/cmd/viewcore/main.go b/cmd/viewcore/main.go
index 076fdf3..9f0d999 100644
--- a/cmd/viewcore/main.go
+++ b/cmd/viewcore/main.go
@@ -6,7 +6,6 @@
 // (See go.dev/issue/32839.)
 //
 //go:build !aix && !plan9 && !wasm
-// +build !aix,!plan9,!wasm
 
 // The viewcore tool is a command-line tool for exploring the state of a Go process
 // that has dumped core.
diff --git a/go.mod b/go.mod
index 2d5817e..b60f9f5 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module golang.org/x/debug
 
-go 1.17
+go 1.18
 
 require (
 	github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
diff --git a/internal/core/core_test.go b/internal/core/core_test.go
index 7c16bda..80b8e7a 100644
--- a/internal/core/core_test.go
+++ b/internal/core/core_test.go
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build darwin dragonfly freebsd linux netbsd openbsd solaris
 
 package core
 
diff --git a/internal/core/process_unix.go b/internal/core/process_unix.go
index f6ba6ab..ea9ab8d 100644
--- a/internal/core/process_unix.go
+++ b/internal/core/process_unix.go
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build darwin dragonfly freebsd linux netbsd openbsd solaris
 
 package core
 
diff --git a/internal/gocore/dominator_test.go b/internal/gocore/dominator_test.go
index 71247d9..79404f3 100644
--- a/internal/gocore/dominator_test.go
+++ b/internal/gocore/dominator_test.go
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build darwin dragonfly freebsd linux netbsd openbsd solaris
 
 package gocore
 
diff --git a/internal/gocore/gocore_test.go b/internal/gocore/gocore_test.go
index 45ff613..3b5996a 100644
--- a/internal/gocore/gocore_test.go
+++ b/internal/gocore/gocore_test.go
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build darwin dragonfly freebsd linux netbsd openbsd solaris
 
 package gocore