mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-23 11:27:29 +00:00
all: cleanup unused code, part 1 (#10661)
Run `staticcheck` with `U1000` to find unused code. This cleans up about a half of it. I'll do the other half separately to keep PRs manageable. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
@@ -6,7 +6,6 @@ package main
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -42,30 +41,6 @@ func makeGoroot(toolchainRoot, outPath string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func copyFile(src, dst string) error {
|
||||
s, err := os.Open(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("opening %q: %v", src, err)
|
||||
}
|
||||
defer s.Close()
|
||||
|
||||
d, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE, 0755)
|
||||
if err != nil {
|
||||
return fmt.Errorf("opening %q: %v", dst, err)
|
||||
}
|
||||
|
||||
if _, err := io.Copy(d, s); err != nil {
|
||||
d.Close()
|
||||
return fmt.Errorf("copying %q to %q: %v", src, dst, err)
|
||||
}
|
||||
|
||||
if err := d.Close(); err != nil {
|
||||
return fmt.Errorf("closing %q: %v", dst, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// linkFarm symlinks every entry in srcDir into outDir, unless that
|
||||
// directory entry already exists.
|
||||
func linkFarm(srcDir, outDir string) error {
|
||||
|
Reference in New Issue
Block a user