$12 GRAYBYTE WORDPRESS FILE MANAGER $91

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/golang/src/crypto/internal/cryptotest/

HOME
Current File : /usr/lib/golang/src/crypto/internal/cryptotest//fetchmodule.go
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package cryptotest

import (
	"bytes"
	"encoding/json"
	"internal/testenv"
	"os"
	"os/exec"
	"testing"
)

// FetchModule fetches the module at the given version and returns the directory
// containing its source tree. It skips the test if fetching modules is not
// possible in this environment.
func FetchModule(t *testing.T, module, version string) string {
	testenv.MustHaveExternalNetwork(t)
	goTool := testenv.GoToolPath(t)

	// If the default GOMODCACHE doesn't exist, use a temporary directory
	// instead. (For example, run.bash sets GOPATH=/nonexist-gopath.)
	out, err := testenv.Command(t, goTool, "env", "GOMODCACHE").Output()
	if err != nil {
		t.Errorf("%s env GOMODCACHE: %v\n%s", goTool, err, out)
		if ee, ok := err.(*exec.ExitError); ok {
			t.Logf("%s", ee.Stderr)
		}
		t.FailNow()
	}
	modcacheOk := false
	if gomodcache := string(bytes.TrimSpace(out)); gomodcache != "" {
		if _, err := os.Stat(gomodcache); err == nil {
			modcacheOk = true
		}
	}
	if !modcacheOk {
		t.Setenv("GOMODCACHE", t.TempDir())
		// Allow t.TempDir() to clean up subdirectories.
		t.Setenv("GOFLAGS", os.Getenv("GOFLAGS")+" -modcacherw")
	}

	t.Logf("fetching %s@%s\n", module, version)

	output, err := testenv.Command(t, goTool, "mod", "download", "-json", module+"@"+version).CombinedOutput()
	if err != nil {
		t.Fatalf("failed to download %s@%s: %s\n%s\n", module, version, err, output)
	}
	var j struct {
		Dir string
	}
	if err := json.Unmarshal(output, &j); err != nil {
		t.Fatalf("failed to parse 'go mod download': %s\n%s\n", err, output)
	}

	return j.Dir
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.30 PM
root / root
0755
aead.go
12.962 KB
4 Dec 2025 6.06 PM
root / root
0644
allocations.go
1.607 KB
4 Dec 2025 6.06 PM
root / root
0644
block.go
7.833 KB
4 Dec 2025 6.06 PM
root / root
0644
blockmode.go
7.945 KB
4 Dec 2025 6.06 PM
root / root
0644
fetchmodule.go
1.687 KB
4 Dec 2025 6.06 PM
root / root
0644
hash.go
0.86 KB
4 Dec 2025 6.06 PM
root / root
0644
implementations.go
1.587 KB
4 Dec 2025 6.06 PM
root / root
0644
methods.go
1.574 KB
4 Dec 2025 6.06 PM
root / root
0644
stream.go
7.515 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF