From 3d334e4a5bb51e85569117ff4a48a8d89cf85534 Mon Sep 17 00:00:00 2001 From: Zhaoyang Date: Tue, 14 Dec 2021 02:25:23 +0800 Subject: [PATCH] fmt code (#2826) --- pkg/dwarf/godwarf/tree.go | 2 +- pkg/proc/amd64util/xsave_other.go | 3 ++- pkg/proc/gdbserial/gdbserver_unix.go | 1 + pkg/proc/macutil/rosetta_other.go | 1 + pkg/proc/native/dump_linux_other.go | 3 ++- pkg/proc/native/dump_other.go | 3 ++- pkg/proc/native/proc_unix.go | 1 + pkg/proc/native/ptrace_darwin.go | 3 ++- pkg/proc/native/ptrace_linux_64bit.go | 1 + pkg/proc/native/registers_darwin_amd64.go | 3 ++- pkg/proc/native/support_sentinel.go | 3 ++- pkg/proc/native/threads_darwin.go | 3 ++- pkg/terminal/terminal_other.go | 1 + pkg/version/buildinfo.go | 1 + service/debugger/debugger_unix.go | 1 + service/debugger/debugger_unix_test.go | 1 + service/internal/sameuser/sameuser.go | 3 ++- service/internal/sameuser/sameuser_linux_test.go | 3 ++- 18 files changed, 27 insertions(+), 10 deletions(-) diff --git a/pkg/dwarf/godwarf/tree.go b/pkg/dwarf/godwarf/tree.go index 0a5f1aad..64cb84d5 100644 --- a/pkg/dwarf/godwarf/tree.go +++ b/pkg/dwarf/godwarf/tree.go @@ -93,7 +93,7 @@ func LoadTree(off dwarf.Offset, dw *dwarf.Data, staticBase uint64) (*Tree, error // EntryToTree converts a single entry, without children, to a *Tree object. func EntryToTree(entry *dwarf.Entry) *Tree { if entry.Children { - panic(fmt.Sprintf("EntryToTree called on entry with children; " + + panic(fmt.Sprintf("EntryToTree called on entry with children; "+ "LoadTree should have been used instead. entry: %+v", entry)) } return entryToTreeInternal(entry) diff --git a/pkg/proc/amd64util/xsave_other.go b/pkg/proc/amd64util/xsave_other.go index aa86dc5e..3905712c 100644 --- a/pkg/proc/amd64util/xsave_other.go +++ b/pkg/proc/amd64util/xsave_other.go @@ -1,4 +1,5 @@ -//+build !amd64 +//go:build !amd64 +// +build !amd64 package amd64util diff --git a/pkg/proc/gdbserial/gdbserver_unix.go b/pkg/proc/gdbserial/gdbserver_unix.go index 5943718a..c5151bf4 100644 --- a/pkg/proc/gdbserial/gdbserver_unix.go +++ b/pkg/proc/gdbserial/gdbserver_unix.go @@ -1,3 +1,4 @@ +//go:build linux || darwin || freebsd // +build linux darwin freebsd package gdbserial diff --git a/pkg/proc/macutil/rosetta_other.go b/pkg/proc/macutil/rosetta_other.go index 5df9f941..1dae72fd 100644 --- a/pkg/proc/macutil/rosetta_other.go +++ b/pkg/proc/macutil/rosetta_other.go @@ -1,3 +1,4 @@ +//go:build !darwin // +build !darwin package macutil diff --git a/pkg/proc/native/dump_linux_other.go b/pkg/proc/native/dump_linux_other.go index 9cd0b61d..d74491af 100644 --- a/pkg/proc/native/dump_linux_other.go +++ b/pkg/proc/native/dump_linux_other.go @@ -1,4 +1,5 @@ -//+build linux,!amd64 +//go:build linux && !amd64 +// +build linux,!amd64 package native diff --git a/pkg/proc/native/dump_other.go b/pkg/proc/native/dump_other.go index 5f92c20e..0c4ce14a 100644 --- a/pkg/proc/native/dump_other.go +++ b/pkg/proc/native/dump_other.go @@ -1,4 +1,5 @@ -//+build freebsd,amd64 darwin +//go:build (freebsd && amd64) || darwin +// +build freebsd,amd64 darwin package native diff --git a/pkg/proc/native/proc_unix.go b/pkg/proc/native/proc_unix.go index 2ca69f3a..f7a48d54 100644 --- a/pkg/proc/native/proc_unix.go +++ b/pkg/proc/native/proc_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package native diff --git a/pkg/proc/native/ptrace_darwin.go b/pkg/proc/native/ptrace_darwin.go index 5fd6ca41..335b879f 100644 --- a/pkg/proc/native/ptrace_darwin.go +++ b/pkg/proc/native/ptrace_darwin.go @@ -1,4 +1,5 @@ -//+build darwin,macnative +//go:build darwin && macnative +// +build darwin,macnative package native diff --git a/pkg/proc/native/ptrace_linux_64bit.go b/pkg/proc/native/ptrace_linux_64bit.go index d31cdf59..c79362f9 100644 --- a/pkg/proc/native/ptrace_linux_64bit.go +++ b/pkg/proc/native/ptrace_linux_64bit.go @@ -1,3 +1,4 @@ +//go:build (linux && amd64) || (linux && arm64) // +build linux,amd64 linux,arm64 package native diff --git a/pkg/proc/native/registers_darwin_amd64.go b/pkg/proc/native/registers_darwin_amd64.go index e036494c..e965ea77 100644 --- a/pkg/proc/native/registers_darwin_amd64.go +++ b/pkg/proc/native/registers_darwin_amd64.go @@ -1,4 +1,5 @@ -//+build darwin,macnative +//go:build darwin && macnative +// +build darwin,macnative package native diff --git a/pkg/proc/native/support_sentinel.go b/pkg/proc/native/support_sentinel.go index d627be9a..bfad9ad2 100644 --- a/pkg/proc/native/support_sentinel.go +++ b/pkg/proc/native/support_sentinel.go @@ -1,5 +1,6 @@ // This file is used to detect build on unsupported GOOS/GOARCH combinations. -//+build !linux,!darwin,!windows,!freebsd linux,!amd64,!arm64,!386 darwin,!amd64,!arm64 windows,!amd64 freebsd,!amd64 +//go:build (!linux && !darwin && !windows && !freebsd) || (linux && !amd64 && !arm64 && !386) || (darwin && !amd64 && !arm64) || (windows && !amd64) || (freebsd && !amd64) +// +build !linux,!darwin,!windows,!freebsd linux,!amd64,!arm64,!386 darwin,!amd64,!arm64 windows,!amd64 freebsd,!amd64 package your_operating_system_and_architecture_combination_is_not_supported_by_delve diff --git a/pkg/proc/native/threads_darwin.go b/pkg/proc/native/threads_darwin.go index 57feb623..e1a82710 100644 --- a/pkg/proc/native/threads_darwin.go +++ b/pkg/proc/native/threads_darwin.go @@ -1,4 +1,5 @@ -//+build darwin,macnative +//go:build darwin && macnative +// +build darwin,macnative package native diff --git a/pkg/terminal/terminal_other.go b/pkg/terminal/terminal_other.go index 70a8fee9..afdf9a0b 100644 --- a/pkg/terminal/terminal_other.go +++ b/pkg/terminal/terminal_other.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package terminal diff --git a/pkg/version/buildinfo.go b/pkg/version/buildinfo.go index 4a34bd56..a43a4e6a 100644 --- a/pkg/version/buildinfo.go +++ b/pkg/version/buildinfo.go @@ -1,3 +1,4 @@ +//go:build go1.12 // +build go1.12 package version diff --git a/service/debugger/debugger_unix.go b/service/debugger/debugger_unix.go index c6b58df4..6ef61293 100644 --- a/service/debugger/debugger_unix.go +++ b/service/debugger/debugger_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package debugger diff --git a/service/debugger/debugger_unix_test.go b/service/debugger/debugger_unix_test.go index 8592968c..975f8552 100644 --- a/service/debugger/debugger_unix_test.go +++ b/service/debugger/debugger_unix_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package debugger diff --git a/service/internal/sameuser/sameuser.go b/service/internal/sameuser/sameuser.go index 5b85e1a0..76d44b07 100644 --- a/service/internal/sameuser/sameuser.go +++ b/service/internal/sameuser/sameuser.go @@ -1,4 +1,5 @@ -//+build !linux +//go:build !linux +// +build !linux package sameuser diff --git a/service/internal/sameuser/sameuser_linux_test.go b/service/internal/sameuser/sameuser_linux_test.go index 6ffd7e65..9eb5cb22 100644 --- a/service/internal/sameuser/sameuser_linux_test.go +++ b/service/internal/sameuser/sameuser_linux_test.go @@ -1,4 +1,5 @@ -//+build linux +//go:build linux +// +build linux package sameuser