Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.31
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
cmd /
go /
testdata /
script /
[ HOME SHELL ]
Name
Size
Permission
Action
README
11.1
KB
-rw-r--r--
bug.txt
815
B
-rw-r--r--
build_GOTMPDIR.txt
352
B
-rw-r--r--
build_acl_windows.txt
1.32
KB
-rw-r--r--
build_cache_arch_mode.txt
359
B
-rw-r--r--
build_cache_compile.txt
430
B
-rw-r--r--
build_cache_gomips.txt
859
B
-rw-r--r--
build_cache_link.txt
644
B
-rw-r--r--
build_cache_output.txt
1.99
KB
-rw-r--r--
build_cache_trimpath.txt
871
B
-rw-r--r--
build_exe.txt
518
B
-rw-r--r--
build_gcflags.txt
442
B
-rw-r--r--
build_i.txt
1012
B
-rw-r--r--
build_import_comment.txt
1.01
KB
-rw-r--r--
build_import_cycle.txt
240
B
-rw-r--r--
build_multi_main.txt
699
B
-rw-r--r--
build_nocache.txt
1.19
KB
-rw-r--r--
build_plugin_non_main.txt
351
B
-rw-r--r--
build_relative_pkgdir.txt
192
B
-rw-r--r--
build_relative_tmpdir.txt
410
B
-rw-r--r--
build_runtime_gcflags.txt
349
B
-rw-r--r--
build_trimpath.txt
3.66
KB
-rw-r--r--
cache_unix.txt
830
B
-rw-r--r--
cache_vet.txt
712
B
-rw-r--r--
cgo_asm_error.txt
321
B
-rw-r--r--
cgo_syso_issue29253.txt
441
B
-rw-r--r--
clean_testcache.txt
585
B
-rw-r--r--
cmd_import_error.txt
491
B
-rw-r--r--
cover_atomic_pkgall.txt
316
B
-rw-r--r--
cover_cgo.txt
381
B
-rw-r--r--
cover_cgo_extra_file.txt
528
B
-rw-r--r--
cover_cgo_extra_test.txt
552
B
-rw-r--r--
cover_cgo_xtest.txt
422
B
-rw-r--r--
cover_import_main_loop.txt
516
B
-rw-r--r--
cover_mod_empty.txt
176
B
-rw-r--r--
cover_modes.txt
669
B
-rw-r--r--
cover_pattern.txt
635
B
-rw-r--r--
cover_pkgall_multiple_mains.tx...
883
B
-rw-r--r--
cover_pkgall_runtime.txt
305
B
-rw-r--r--
cpu_profile_twice.txt
391
B
-rw-r--r--
devnull.txt
525
B
-rw-r--r--
doc.txt
1.2
KB
-rw-r--r--
env_write.txt
3.33
KB
-rw-r--r--
fileline.txt
201
B
-rw-r--r--
fmt_load_errors.txt
295
B
-rw-r--r--
gccgo_m.txt
315
B
-rw-r--r--
gccgo_mangle.txt
137
B
-rw-r--r--
gcflags_patterns.txt
2.17
KB
-rw-r--r--
generate_bad_imports.txt
246
B
-rw-r--r--
get_404_meta.txt
277
B
-rw-r--r--
get_brace.txt
1.33
KB
-rw-r--r--
get_dotfiles.txt
1.6
KB
-rw-r--r--
get_insecure_redirect.txt
394
B
-rw-r--r--
get_tilde.txt
779
B
-rw-r--r--
get_unicode.txt
1.25
KB
-rw-r--r--
get_with_git_trace.txt
139
B
-rw-r--r--
goflags.txt
1.34
KB
-rw-r--r--
gopath_install.txt
1.6
KB
-rw-r--r--
gopath_local.txt
2.94
KB
-rw-r--r--
gopath_moved_repo.txt
1.69
KB
-rw-r--r--
gopath_paths.txt
1.05
KB
-rw-r--r--
gopath_std_vendor.txt
1.36
KB
-rw-r--r--
gopath_vendor_dup_err.txt
391
B
-rw-r--r--
help.txt
1.17
KB
-rw-r--r--
import_main.txt
1.71
KB
-rw-r--r--
install_cleans_build.txt
507
B
-rw-r--r--
install_cmd_gobin.txt
370
B
-rw-r--r--
install_cross_gobin.txt
633
B
-rw-r--r--
install_rebuild_gopath.txt
465
B
-rw-r--r--
install_rebuild_removed.txt
688
B
-rw-r--r--
link_syso_issue33139.txt
1.16
KB
-rw-r--r--
linkname.txt
210
B
-rw-r--r--
list_ambiguous_path.txt
1.06
KB
-rw-r--r--
list_bad_import.txt
2.13
KB
-rw-r--r--
list_compiled_imports.txt
681
B
-rw-r--r--
list_constraints.txt
1.71
KB
-rw-r--r--
list_find.txt
748
B
-rw-r--r--
list_importmap.txt
939
B
-rw-r--r--
list_linkshared.txt
297
B
-rw-r--r--
list_parse_err.txt
266
B
-rw-r--r--
list_split_main.txt
439
B
-rw-r--r--
list_std.txt
693
B
-rw-r--r--
list_test_e.txt
239
B
-rw-r--r--
list_test_err.txt
2.67
KB
-rw-r--r--
list_test_imports.txt
465
B
-rw-r--r--
list_test_non_go_files.txt
306
B
-rw-r--r--
list_wildcard_skip_nonmatching...
282
B
-rw-r--r--
mod_alt_goroot.txt
535
B
-rw-r--r--
mod_ambiguous_import.txt
1.48
KB
-rw-r--r--
mod_auth.txt
744
B
-rw-r--r--
mod_bad_domain.txt
1.1
KB
-rw-r--r--
mod_bad_filenames.txt
568
B
-rw-r--r--
mod_build_info_err.txt
448
B
-rw-r--r--
mod_build_tags.txt
538
B
-rw-r--r--
mod_build_versioned.txt
346
B
-rw-r--r--
mod_cache_rw.txt
2.01
KB
-rw-r--r--
mod_case.txt
409
B
-rw-r--r--
mod_case_cgo.txt
94
B
-rw-r--r--
mod_clean_cache.txt
1.78
KB
-rw-r--r--
mod_concurrent.txt
785
B
-rw-r--r--
mod_convert_dep.txt
912
B
-rw-r--r--
mod_convert_git.txt
614
B
-rw-r--r--
mod_convert_glide.txt
460
B
-rw-r--r--
mod_convert_glockfile.txt
458
B
-rw-r--r--
mod_convert_godeps.txt
479
B
-rw-r--r--
mod_convert_tsv.txt
472
B
-rw-r--r--
mod_convert_tsv_insecure.txt
596
B
-rw-r--r--
mod_convert_vendor_conf.txt
462
B
-rw-r--r--
mod_convert_vendor_json.txt
475
B
-rw-r--r--
mod_convert_vendor_manifest.tx...
469
B
-rw-r--r--
mod_convert_vendor_yml.txt
460
B
-rw-r--r--
mod_dir.txt
221
B
-rw-r--r--
mod_doc.txt
2.6
KB
-rw-r--r--
mod_domain_root.txt
192
B
-rw-r--r--
mod_dot.txt
1.2
KB
-rw-r--r--
mod_download.txt
5.06
KB
-rw-r--r--
mod_download_hash.txt
877
B
-rw-r--r--
mod_download_json.txt
261
B
-rw-r--r--
mod_download_partial.txt
1.67
KB
-rw-r--r--
mod_download_replace_file.txt
398
B
-rw-r--r--
mod_edit.txt
3.46
KB
-rw-r--r--
mod_edit_go.txt
461
B
-rw-r--r--
mod_empty_err.txt
996
B
-rw-r--r--
mod_enabled.txt
1.71
KB
-rw-r--r--
mod_file_proxy.txt
1.23
KB
-rw-r--r--
mod_find.txt
2.22
KB
-rw-r--r--
mod_fs_patterns.txt
1.68
KB
-rw-r--r--
mod_get_cmd.txt
536
B
-rw-r--r--
mod_get_commit.txt
1.39
KB
-rw-r--r--
mod_get_direct.txt
432
B
-rw-r--r--
mod_get_downgrade.txt
1.51
KB
-rw-r--r--
mod_get_fallback.txt
246
B
-rw-r--r--
mod_get_hash.txt
620
B
-rw-r--r--
mod_get_incompatible.txt
431
B
-rw-r--r--
mod_get_indirect.txt
1.58
KB
-rw-r--r--
mod_get_insecure_redirect.txt
906
B
-rw-r--r--
mod_get_latest_pseudo.txt
276
B
-rw-r--r--
mod_get_local.txt
1.51
KB
-rw-r--r--
mod_get_main.txt
1.15
KB
-rw-r--r--
mod_get_major.txt
626
B
-rw-r--r--
mod_get_moved.txt
1.23
KB
-rw-r--r--
mod_get_newcycle.txt
477
B
-rw-r--r--
mod_get_none.txt
253
B
-rw-r--r--
mod_get_patterns.txt
1.13
KB
-rw-r--r--
mod_get_private_vcs.txt
335
B
-rw-r--r--
mod_get_pseudo.txt
2.22
KB
-rw-r--r--
mod_get_pseudo_other_branch.tx...
1.48
KB
-rw-r--r--
mod_get_pseudo_prefix.txt
1.63
KB
-rw-r--r--
mod_get_svn.txt
1.58
KB
-rw-r--r--
mod_get_tags.txt
791
B
-rw-r--r--
mod_get_test.txt
1.25
KB
-rw-r--r--
mod_get_trailing_slash.txt
967
B
-rw-r--r--
mod_get_upgrade.txt
1.17
KB
-rw-r--r--
mod_get_upgrade_pseudo.txt
2.24
KB
-rw-r--r--
mod_getmode_vendor.txt
1.05
KB
-rw-r--r--
mod_getx.txt
400
B
-rw-r--r--
mod_git_export_subst.txt
549
B
-rw-r--r--
mod_go_version.txt
1010
B
-rw-r--r--
mod_go_version_mixed.txt
646
B
-rw-r--r--
mod_gobuild_import.txt
2.91
KB
-rw-r--r--
mod_gofmt_invalid.txt
207
B
-rw-r--r--
mod_gonoproxy.txt
960
B
-rw-r--r--
mod_gopkg_unstable.txt
425
B
-rw-r--r--
mod_goroot_errors.txt
1.86
KB
-rw-r--r--
mod_graph.txt
207
B
-rw-r--r--
mod_help.txt
132
B
-rw-r--r--
mod_import.txt
375
B
-rw-r--r--
mod_import_mod.txt
143
B
-rw-r--r--
mod_import_v1suffix.txt
187
B
-rw-r--r--
mod_in_testdata_dir.txt
974
B
-rw-r--r--
mod_indirect.txt
1.3
KB
-rw-r--r--
mod_indirect_main.txt
1.38
KB
-rw-r--r--
mod_indirect_tidy.txt
804
B
-rw-r--r--
mod_init_dep.txt
1010
B
-rw-r--r--
mod_init_empty.txt
192
B
-rw-r--r--
mod_init_glide.txt
582
B
-rw-r--r--
mod_init_path.txt
214
B
-rw-r--r--
mod_install_versioned.txt
211
B
-rw-r--r--
mod_internal.txt
2.33
KB
-rw-r--r--
mod_invalid_version.txt
12.99
KB
-rw-r--r--
mod_issue35317.txt
244
B
-rw-r--r--
mod_list.txt
1.97
KB
-rw-r--r--
mod_list_bad_import.txt
2.31
KB
-rw-r--r--
mod_list_compiled_concurrent.t...
1.65
KB
-rw-r--r--
mod_list_dir.txt
1.18
KB
-rw-r--r--
mod_list_direct.txt
520
B
-rw-r--r--
mod_list_e_readonly.txt
449
B
-rw-r--r--
mod_list_pseudo.txt
1.74
KB
-rw-r--r--
mod_list_replace_dir.txt
459
B
-rw-r--r--
mod_list_std.txt
1.87
KB
-rw-r--r--
mod_list_test.txt
278
B
-rw-r--r--
mod_list_upgrade.txt
131
B
-rw-r--r--
mod_list_upgrade_pseudo.txt
785
B
-rw-r--r--
mod_load_badchain.txt
2.88
KB
-rw-r--r--
mod_load_badmod.txt
516
B
-rw-r--r--
mod_load_badzip.txt
506
B
-rw-r--r--
mod_local_replace.txt
329
B
-rw-r--r--
mod_missing_repo.txt
512
B
-rw-r--r--
mod_missingpkg_prerelease.txt
329
B
-rw-r--r--
mod_modinfo.txt
1.79
KB
-rw-r--r--
mod_multirepo.txt
883
B
-rw-r--r--
mod_nomod.txt
644
B
-rw-r--r--
mod_off.txt
1.05
KB
-rw-r--r--
mod_off_init.txt
225
B
-rw-r--r--
mod_outside.txt
9.77
KB
-rw-r--r--
mod_patterns.txt
2.39
KB
-rw-r--r--
mod_patterns_vendor.txt
528
B
-rw-r--r--
mod_permissions.txt
1.24
KB
-rw-r--r--
mod_prefer_compatible.txt
2.48
KB
-rw-r--r--
mod_proxy_errors.txt
697
B
-rw-r--r--
mod_proxy_https.txt
462
B
-rw-r--r--
mod_proxy_list.txt
794
B
-rw-r--r--
mod_pseudo_cache.txt
1.13
KB
-rw-r--r--
mod_query.txt
990
B
-rw-r--r--
mod_query_empty.txt
2.73
KB
-rw-r--r--
mod_query_exclude.txt
489
B
-rw-r--r--
mod_readonly.txt
2.18
KB
-rw-r--r--
mod_replace.txt
3.69
KB
-rw-r--r--
mod_replace_gopkgin.txt
2.3
KB
-rw-r--r--
mod_replace_import.txt
2.66
KB
-rw-r--r--
mod_require_exclude.txt
609
B
-rw-r--r--
mod_retention.txt
2.49
KB
-rw-r--r--
mod_run_path.txt
359
B
-rw-r--r--
mod_std_vendor.txt
1.89
KB
-rw-r--r--
mod_string_alias.txt
146
B
-rw-r--r--
mod_sum_replaced.txt
683
B
-rw-r--r--
mod_sumdb.txt
1.04
KB
-rw-r--r--
mod_sumdb_cache.txt
1.26
KB
-rw-r--r--
mod_sumdb_file_path.txt
2.32
KB
-rw-r--r--
mod_sumdb_golang.txt
1.19
KB
-rw-r--r--
mod_sumdb_proxy.txt
1.4
KB
-rw-r--r--
mod_symlink.txt
1016
B
-rw-r--r--
mod_test.txt
2.17
KB
-rw-r--r--
mod_test_cached.txt
1.49
KB
-rw-r--r--
mod_test_files.txt
1.1
KB
-rw-r--r--
mod_tidy.txt
897
B
-rw-r--r--
mod_tidy_cycle.txt
949
B
-rw-r--r--
mod_tidy_error.txt
1.17
KB
-rw-r--r--
mod_tidy_quote.txt
429
B
-rw-r--r--
mod_tidy_replace.txt
2.89
KB
-rw-r--r--
mod_tidy_sum.txt
748
B
-rw-r--r--
mod_upgrade_patch.txt
2.96
KB
-rw-r--r--
mod_vcs_missing.txt
491
B
-rw-r--r--
mod_vendor.txt
6.23
KB
-rw-r--r--
mod_vendor_auto.txt
9.29
KB
-rw-r--r--
mod_vendor_build.txt
888
B
-rw-r--r--
mod_vendor_nodeps.txt
118
B
-rw-r--r--
mod_vendor_replace.txt
1.79
KB
-rw-r--r--
mod_vendor_trimpath.txt
1.13
KB
-rw-r--r--
mod_vendor_unused.txt
1.43
KB
-rw-r--r--
mod_verify.txt
2.34
KB
-rw-r--r--
mod_versions.txt
377
B
-rw-r--r--
mod_why.txt
2.24
KB
-rw-r--r--
modfile_flag.txt
2.38
KB
-rw-r--r--
noncanonical_import.txt
352
B
-rw-r--r--
pattern_syntax_error.txt
185
B
-rw-r--r--
prevent_sys_unix_import.txt
175
B
-rw-r--r--
run_hello.txt
140
B
-rw-r--r--
run_hello_pkg.txt
168
B
-rw-r--r--
run_internal.txt
1.14
KB
-rw-r--r--
run_set_executable_name.txt
627
B
-rw-r--r--
run_wildcard.txt
223
B
-rw-r--r--
script_wait.txt
485
B
-rw-r--r--
std_vendor.txt
966
B
-rw-r--r--
sum_readonly.txt
469
B
-rw-r--r--
test_bad_example.txt
234
B
-rw-r--r--
test_badtest.txt
805
B
-rw-r--r--
test_benchmark_chatty_fail.txt
739
B
-rw-r--r--
test_benchmark_chatty_success....
629
B
-rw-r--r--
test_benchmark_fatal.txt
310
B
-rw-r--r--
test_benchmark_labels.txt
383
B
-rw-r--r--
test_cache_inputs.txt
4.85
KB
-rw-r--r--
test_chatty_fail.txt
719
B
-rw-r--r--
test_chatty_parallel_fail.txt
2.79
KB
-rw-r--r--
test_chatty_parallel_success.t...
2.62
KB
-rw-r--r--
test_chatty_parallel_success_s...
886
B
-rw-r--r--
test_chatty_success.txt
937
B
-rw-r--r--
test_compile_binary.txt
136
B
-rw-r--r--
test_compile_tempfile.txt
273
B
-rw-r--r--
test_flag.txt
362
B
-rw-r--r--
test_generated_main.txt
941
B
-rw-r--r--
test_go111module_cache.txt
206
B
-rw-r--r--
test_import_error_stack.txt
384
B
-rw-r--r--
test_json_panic_exit.txt
1.2
KB
-rw-r--r--
test_main_archive.txt
436
B
-rw-r--r--
test_main_panic.txt
603
B
-rw-r--r--
test_main_twice.txt
482
B
-rw-r--r--
test_match_no_tests_build_fail...
368
B
-rw-r--r--
test_minus_n.txt
204
B
-rw-r--r--
test_no_tests.txt
195
B
-rw-r--r--
test_race.txt
611
B
-rw-r--r--
test_race_cover_mode_issue2043...
651
B
-rw-r--r--
test_rebuildall.txt
328
B
-rw-r--r--
test_regexps.txt
1.9
KB
-rw-r--r--
test_status.txt
220
B
-rw-r--r--
test_syntax_error_says_fail.tx...
303
B
-rw-r--r--
test_timeout.txt
448
B
-rw-r--r--
vendor_complex.txt
1.21
KB
-rw-r--r--
version.txt
713
B
-rw-r--r--
vet_asm.txt
583
B
-rw-r--r--
vet_deps.txt
354
B
-rw-r--r--
vet_flags.txt
1.41
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : README
This directory holds test scripts *.txt run during 'go test cmd/go'. To run a specific script foo.txt go test cmd/go -run=Script/^foo$ In general script files should have short names: a few words, not whole sentences. The first word should be the general category of behavior being tested, often the name of a go subcommand (list, build, test, ...) or concept (vendor, pattern). Each script is a text archive (go doc cmd/go/internal/txtar). The script begins with an actual command script to run followed by the content of zero or more supporting files to create in the script's temporary file system before it starts executing. As an example, run_hello.txt says: # hello world go run hello.go stderr 'hello world' ! stdout . -- hello.go -- package main func main() { println("hello world") } Each script runs in a fresh temporary work directory tree, available to scripts as $WORK. Scripts also have access to these other environment variables: GOARCH=<target GOARCH> GOCACHE=<actual GOCACHE being used outside the test> GOEXE=<executable file suffix: .exe on Windows, empty on other systems> GOOS=<target GOOS> GOPATH=$WORK/gopath GOPROXY=<local module proxy serving from cmd/go/testdata/mod> GOROOT=<actual GOROOT> HOME=/no-home PATH=<actual PATH> TMPDIR=$WORK/tmp devnull=<value of os.DevNull> goversion=<current Go version; for example, 1.12> :=<OS-specific path list separator> The scripts' supporting files are unpacked relative to $GOPATH/src (aka $WORK/gopath/src) and then the script begins execution in that directory as well. Thus the example above runs in $WORK/gopath/src with GOPATH=$WORK/gopath and $WORK/gopath/src/hello.go containing the listed contents. The lines at the top of the script are a sequence of commands to be executed by a tiny script engine in ../../script_test.go (not the system shell). The script stops and the overall test fails if any particular command fails. Each line is parsed into a sequence of space-separated command words, with environment variable expansion and # marking an end-of-line comment. Adding single quotes around text keeps spaces in that text from being treated as word separators and also disables environment variable expansion. Inside a single-quoted block of text, a repeated single quote indicates a literal single quote, as in: 'Don''t communicate by sharing memory.' A line beginning with # is a comment and conventionally explains what is being done or tested at the start of a new phase in the script. The command prefix ! indicates that the command on the rest of the line (typically go or a matching predicate) must fail, not succeed. Only certain commands support this prefix. They are indicated below by [!] in the synopsis. The command prefix [cond] indicates that the command on the rest of the line should only run when the condition is satisfied. The available conditions are: - GOOS and GOARCH values, like [386], [windows], and so on. - Compiler names, like [gccgo], [gc]. - Test environment details: - [short] for testing.Short() - [cgo], [msan], [race] for whether cgo, msan, and the race detector can be used - [net] for whether the external network can be used - [link] for testenv.HasLink() - [root] for os.Geteuid() == 0 - [symlink] for testenv.HasSymlink() - [exec:prog] for whether prog is available for execution (found by exec.LookPath) - [GODEBUG:value] for whether value is one of the comma-separated entries in the GODEBUG variable - [buildmode:value] for whether -buildmode=value is supported A condition can be negated: [!short] means to run the rest of the line when testing.Short() is false. Multiple conditions may be given for a single command, for example, '[linux] [amd64] skip'. The command will run if all conditions are satisfied. The commands are: - [!] cc args... [&] Run the C compiler, the platform specific flags (i.e. `go env GOGCCFLAGS`) will be added automatically before args. - cd dir Change to the given directory for future commands. - chmod perm path... Change the permissions of the files or directories named by the path arguments to be equal to perm. Only numerical permissions are supported. - cmp file1 file2 Check that the named files have the same content. By convention, file1 is the actual data and file2 the expected data. File1 can be "stdout" or "stderr" to use the standard output or standard error from the most recent exec or go command. (If the files have differing content, the failure prints a diff.) - cmpenv file1 file2 Like cmp, but environment variables are substituted in the file contents before the comparison. For example, $GOOS is replaced by the target GOOS. - [!] cp src... dst Copy the listed files to the target file or existing directory. src can include "stdout" or "stderr" to use the standard output or standard error from the most recent exec or go command. - env [-r] [key=value...] With no arguments, print the environment to stdout (useful for debugging and for verifying initial state). Otherwise add the listed key=value pairs to the environment. The -r flag causes the values to be escaped using regexp.QuoteMeta before being recorded. - [!] exec program [args...] [&] Run the given executable program with the arguments. It must (or must not) succeed. Note that 'exec' does not terminate the script (unlike in Unix shells). If the last token is '&', the program executes in the background. The standard output and standard error of the previous command is cleared, but the output of the background process is buffered — and checking of its exit status is delayed — until the next call to 'wait', 'skip', or 'stop' or the end of the test. At the end of the test, any remaining background processes are terminated using os.Interrupt (if supported) or os.Kill. - [!] exists [-readonly] file... Each of the listed files or directories must (or must not) exist. If -readonly is given, the files or directories must be unwritable. - [!] go args... [&] Run the (test copy of the) go command with the given arguments. It must (or must not) succeed. - [!] grep [-count=N] [-q] pattern file The file's content must (or must not) match the regular expression pattern. For positive matches, -count=N specifies an exact number of matches to require. The -q flag disables printing the file content on a mismatch. - mkdir path... Create the listed directories, if they do not already exists. - rm file... Remove the listed files or directories. - skip [message] Mark the test skipped, including the message if given. - [!] stale path... The packages named by the path arguments must (or must not) be reported as "stale" by the go command. - [!] stderr [-count=N] pattern Apply the grep command (see above) to the standard error from the most recent exec, go, or wait command. - [!] stdout [-count=N] pattern Apply the grep command (see above) to the standard output from the most recent exec, go, wait, or env command. - stop [message] Stop the test early (marking it as passing), including the message if given. - symlink file -> target Create file as a symlink to target. The -> (like in ls -l output) is required. - wait Wait for all 'exec' and 'go' commands started in the background (with the '&' token) to exit, and display success or failure status for them. After a call to wait, the 'stderr' and 'stdout' commands will apply to the concatenation of the corresponding streams of the background commands, in the order in which those commands were started. When TestScript runs a script and the script fails, by default TestScript shows the execution of the most recent phase of the script (since the last # comment) and only shows the # comments for earlier phases. For example, here is a multi-phase script with a bug in it: # GOPATH with p1 in d2, p2 in d2 env GOPATH=$WORK/d1${:}$WORK/d2 # build & install p1 env go install -i p1 ! stale p1 ! stale p2 # modify p2 - p1 should appear stale cp $WORK/p2x.go $WORK/d2/src/p2/p2.go stale p1 p2 # build & install p1 again go install -i p11 ! stale p1 ! stale p2 -- $WORK/d1/src/p1/p1.go -- package p1 import "p2" func F() { p2.F() } -- $WORK/d2/src/p2/p2.go -- package p2 func F() {} -- $WORK/p2x.go -- package p2 func F() {} func G() {} The bug is that the final phase installs p11 instead of p1. The test failure looks like: $ go test -run=Script --- FAIL: TestScript (3.75s) --- FAIL: TestScript/install_rebuild_gopath (0.16s) script_test.go:223: # GOPATH with p1 in d2, p2 in d2 (0.000s) # build & install p1 (0.087s) # modify p2 - p1 should appear stale (0.029s) # build & install p1 again (0.022s) > go install -i p11 [stderr] can't load package: package p11: cannot find package "p11" in any of: /Users/rsc/go/src/p11 (from $GOROOT) $WORK/d1/src/p11 (from $GOPATH) $WORK/d2/src/p11 [exit status 1] FAIL: unexpected go command failure script_test.go:73: failed at testdata/script/install_rebuild_gopath.txt:15 in $WORK/gopath/src FAIL exit status 1 FAIL cmd/go 4.875s $ Note that the commands in earlier phases have been hidden, so that the relevant commands are more easily found, and the elapsed time for a completed phase is shown next to the phase heading. To see the entire execution, use "go test -v", which also adds an initial environment dump to the beginning of the log. Note also that in reported output, the actual name of the per-script temporary directory has been consistently replaced with the literal string $WORK. The cmd/go test flag -testwork (which must appear on the "go test" command line after standard test flags) causes each test to log the name of its $WORK directory and other environment variable settings and also to leave that directory behind when it exits, for manual debugging of failing tests: $ go test -run=Script -work --- FAIL: TestScript (3.75s) --- FAIL: TestScript/install_rebuild_gopath (0.16s) script_test.go:223: WORK=/tmp/cmd-go-test-745953508/script-install_rebuild_gopath GOARCH= GOCACHE=/Users/rsc/Library/Caches/go-build GOOS= GOPATH=$WORK/gopath GOROOT=/Users/rsc/go HOME=/no-home TMPDIR=$WORK/tmp exe= # GOPATH with p1 in d2, p2 in d2 (0.000s) # build & install p1 (0.085s) # modify p2 - p1 should appear stale (0.030s) # build & install p1 again (0.019s) > go install -i p11 [stderr] can't load package: package p11: cannot find package "p11" in any of: /Users/rsc/go/src/p11 (from $GOROOT) $WORK/d1/src/p11 (from $GOPATH) $WORK/d2/src/p11 [exit status 1] FAIL: unexpected go command failure script_test.go:73: failed at testdata/script/install_rebuild_gopath.txt:15 in $WORK/gopath/src FAIL exit status 1 FAIL cmd/go 4.875s $ $ WORK=/tmp/cmd-go-test-745953508/script-install_rebuild_gopath $ cd $WORK/d1/src/p1 $ cat p1.go package p1 import "p2" func F() { p2.F() } $
Close