text
stringlengths
2
1.1M
id
stringlengths
11
117
metadata
dict
__index_level_0__
int64
0
885
// Copyright 2022 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 gocommand import ( "strconv" "testing" ) func TestParseGoVersionOutput(t *testing.T) { tests := []struct { args string want string }{ {"go v...
tools/internal/gocommand/version_test.go/0
{ "file_path": "tools/internal/gocommand/version_test.go", "repo_id": "tools", "token_count": 418 }
749
// Copyright 2020 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 jsonrpc2 import ( "context" "net" "sync" "testing" "time" "golang.org/x/tools/internal/stack/stacktest" "golang.org/x/tools/internal/testenv" )...
tools/internal/jsonrpc2/serve_test.go/0
{ "file_path": "tools/internal/jsonrpc2/serve_test.go", "repo_id": "tools", "token_count": 529 }
750
// Copyright 2018 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 jsonrpc2 import ( "encoding/json" ) // This file contains the go forms of the wire specification. // see http://www.jsonrpc.org/specification for det...
tools/internal/jsonrpc2_v2/wire.go/0
{ "file_path": "tools/internal/jsonrpc2_v2/wire.go", "repo_id": "tools", "token_count": 949 }
751
// Copyright 2023 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. //go:build ignore // +build ignore // The pprof command prints the total time in a pprof profile provided // through the standard input. package main import (...
tools/internal/pprof/main.go/0
{ "file_path": "tools/internal/pprof/main.go", "repo_id": "tools", "token_count": 259 }
752
// Copyright 2023 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 inline implements inlining of Go function calls. The client provides information about the caller and callee, including the source text, syntax tree...
tools/internal/refactor/inline/doc.go/0
{ "file_path": "tools/internal/refactor/inline/doc.go", "repo_id": "tools", "token_count": 3174 }
753
Test of implicit field selections in method calls. The two level wrapping T -> unexported -> U is required to exercise the implicit selections exportedness check; with only a single level, the receiver declaration in "func (unexported) F()" would fail the earlier unexportedness check. -- go.mod -- module testdata go ...
tools/internal/refactor/inline/testdata/embed.txtar/0
{ "file_path": "tools/internal/refactor/inline/testdata/embed.txtar", "repo_id": "tools", "token_count": 196 }
754
Test of parameter substitution. -- go.mod -- module testdata go 1.12 -- a/a0.go -- package a var _ = add(2, 1+1) //@ inline(re"add", add) func add(x, y int) int { return x + 2*y } -- add -- package a var _ = 2 + 2*(1+1) //@ inline(re"add", add) func add(x, y int) int { return x + 2*y }
tools/internal/refactor/inline/testdata/param-subst.txtar/0
{ "file_path": "tools/internal/refactor/inline/testdata/param-subst.txtar", "repo_id": "tools", "token_count": 127 }
755
// Copyright 2020 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 stack import ( "bufio" "errors" "io" "regexp" "strconv" ) var ( reBlank = regexp.MustCompile(`^\s*$`) reGoroutine = regexp.MustCompile(`^\s...
tools/internal/stack/parse.go/0
{ "file_path": "tools/internal/stack/parse.go", "repo_id": "tools", "token_count": 1481 }
756
//go:build go1.20 package versions // want "pre.go@go1.20"
tools/internal/testfiles/testdata/versions/pre.go/0
{ "file_path": "tools/internal/testfiles/testdata/versions/pre.go", "repo_id": "tools", "token_count": 25 }
757
// Copyright 2021 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 typeparams_test import ( "go/ast" "go/parser" "go/token" "go/types" "regexp" "strings" "testing" . "golang.org/x/tools/internal/typeparams" ) ...
tools/internal/typeparams/normalize_test.go/0
{ "file_path": "tools/internal/typeparams/normalize_test.go", "repo_id": "tools", "token_count": 1251 }
758
// Copyright 2023 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. //go:build !go1.22 // +build !go1.22 package versions import ( "go/ast" "go/types" ) // FileVersion returns a language version (<=1.21) derived from runtim...
tools/internal/versions/types_go121.go/0
{ "file_path": "tools/internal/versions/types_go121.go", "repo_id": "tools", "token_count": 278 }
759
// Copyright 2012 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 present import ( "fmt" "strings" ) func init() { Register("image", parseImage) } type Image struct { Cmd string // original command from prese...
tools/present/image.go/0
{ "file_path": "tools/present/image.go", "repo_id": "tools", "token_count": 461 }
760
# Media ## .image gopher.jpg _ 100 .caption A gopher. .iframe https://golang.org/ .link https://golang.org/ The Gopher's home. .html testdata/media.html --- <h1>Media</h1> <section> <img src="gopher.jpg" width="100" alt=""> <figcaption>A gopher.</figcaption> <iframe src="https://golang.org/"></iframe> <p class="l...
tools/present/testdata/media.md/0
{ "file_path": "tools/present/testdata/media.md", "repo_id": "tools", "token_count": 172 }
761
package B1 import "time" var startup = time.Now() func example() time.Duration { before := time.Now() time.Sleep(1) return time.Now().Sub(before) } func msSinceStartup() int64 { return int64(time.Now().Sub(startup) / time.Millisecond) }
tools/refactor/eg/testdata/B1.go/0
{ "file_path": "tools/refactor/eg/testdata/B1.go", "repo_id": "tools", "token_count": 92 }
762
package G1 import "go/ast" func example() { _ = ast.BadExpr{123, 456} // match _ = ast.BadExpr{123, 456} // no match _ = ast.BadExpr{From: 123} // no match _ = ast.BadExpr{To: 456} // no match }
tools/refactor/eg/testdata/G1.golden/0
{ "file_path": "tools/refactor/eg/testdata/G1.golden", "repo_id": "tools", "token_count": 94 }
763
// Copyright 2015 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. // Incomplete std lib sources on Android. //go:build !android // +build !android package importgraph_test import ( "fmt" "go/build" "os" "sort" "strings...
tools/refactor/importgraph/graph_test.go/0
{ "file_path": "tools/refactor/importgraph/graph_test.go", "repo_id": "tools", "token_count": 1923 }
764
### Release process The golang.go-nightly extension is released daily during weekdays, based on the latest commit to the master branch. (Note: the release process is currently in GH workflow. We are in process of moving it to a GCB workflow.) * Dockerfile: defines the image containing tools and environments needed t...
vscode-go/build/README.md/0
{ "file_path": "vscode-go/build/README.md", "repo_id": "vscode-go", "token_count": 155 }
765
module.exports = { ...require('.prettierrc.json') }
vscode-go/extension/.prettierrc.js/0
{ "file_path": "vscode-go/extension/.prettierrc.js", "repo_id": "vscode-go", "token_count": 22 }
766
{ ".source.go": { "single import": { "prefix": "im", "body": "import \"${1:package}\"", "description": "Snippet for import statement" }, "multiple imports": { "prefix": "ims", "body": "import (\n\t\"${1:package}\"\n)", "description": "Snippet for a import block" }, "single constant": { "...
vscode-go/extension/snippets/go.json/0
{ "file_path": "vscode-go/extension/snippets/go.json", "repo_id": "vscode-go", "token_count": 3928 }
767
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable no-case-declarations */ /* eslint-disable eqeqeq */ /* eslint-disable no-useless-escape */ /* eslint-disable no-async-promise-executor */ /* eslint-disable @typescript-eslint/no-explicit-any */ /*---------------------------------------------------...
vscode-go/extension/src/debugAdapter/goDebug.ts/0
{ "file_path": "vscode-go/extension/src/debugAdapter/goDebug.ts", "repo_id": "vscode-go", "token_count": 36296 }
768
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable eqeqeq */ /* eslint-disable @typescript-eslint/no-explicit-any */ /*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE in the projec...
vscode-go/extension/src/goGenerateTests.ts/0
{ "file_path": "vscode-go/extension/src/goGenerateTests.ts", "repo_id": "vscode-go", "token_count": 2670 }
769
/*--------------------------------------------------------- * Copyright 2023 The Go Authors. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------*/ import * as vscode from 'vscode'; import { getGoCon...
vscode-go/extension/src/goTaskProvider.ts/0
{ "file_path": "vscode-go/extension/src/goTaskProvider.ts", "repo_id": "vscode-go", "token_count": 1967 }
770
/* eslint-disable @typescript-eslint/no-explicit-any */ /*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *-------------------------------------------------...
vscode-go/extension/src/language/legacy/goFormat.ts/0
{ "file_path": "vscode-go/extension/src/language/legacy/goFormat.ts", "repo_id": "vscode-go", "token_count": 1822 }
771
/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. * Modification copyright 2021 The Go Authors. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *-------------------------------------...
vscode-go/extension/src/utils/wmicProcessParser.ts/0
{ "file_path": "vscode-go/extension/src/utils/wmicProcessParser.ts", "repo_id": "vscode-go", "token_count": 887 }
772
/* eslint-disable @typescript-eslint/no-explicit-any */ /*--------------------------------------------------------- * Copyright 2020 The Go Authors. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *-------------------------------------------------------...
vscode-go/extension/test/integration/test.test.ts/0
{ "file_path": "vscode-go/extension/test/integration/test.test.ts", "repo_id": "vscode-go", "token_count": 3012 }
773
//go:build go1.18 // +build go1.18 package main import ( "testing" ) func FuzzFunc(f *testing.F) { } func Fuzz(f *testing.F) { } func TestGo118(t *testing.T) { }
vscode-go/extension/test/testdata/codelens/codelens_go118_test.go/0
{ "file_path": "vscode-go/extension/test/testdata/codelens/codelens_go118_test.go", "repo_id": "vscode-go", "token_count": 80 }
774
module example/cwdTest go 1.15
vscode-go/extension/test/testdata/cwdTest/cwdTest/go.mod/0
{ "file_path": "vscode-go/extension/test/testdata/cwdTest/cwdTest/go.mod", "repo_id": "vscode-go", "token_count": 13 }
775
module github.com/microsoft/vscode-go/gofixtures/gogetdoctestdata go 1.14
vscode-go/extension/test/testdata/gogetdocTestData/go.mod/0
{ "file_path": "vscode-go/extension/test/testdata/gogetdocTestData/go.mod", "repo_id": "vscode-go", "token_count": 31 }
776
module github.com/microsoft/vscode-go/gofixtures/outlinetest go 1.14
vscode-go/extension/test/testdata/outlineTest/go.mod/0
{ "file_path": "vscode-go/extension/test/testdata/outlineTest/go.mod", "repo_id": "vscode-go", "token_count": 28 }
777
package main import ( "fmt" "example/vendorpls" ) func main() { fmt.Prinln(vendorpls.F()) }
vscode-go/extension/test/testdata/vendoring/main.go/0
{ "file_path": "vscode-go/extension/test/testdata/vendoring/main.go", "repo_id": "vscode-go", "token_count": 48 }
778
Tree Kill ========= Kill all processes in the process tree, including the root process. Examples ======= Kill all the descendent processes of the process with pid `1`, including the process with pid `1` itself: ```js var kill = require('tree-kill'); kill(1); ``` Send a signal other than SIGTERM.: ```js var kill = r...
vscode-go/extension/third_party/tree-kill/README.md/0
{ "file_path": "vscode-go/extension/third_party/tree-kill/README.md", "repo_id": "vscode-go", "token_count": 650 }
779
jq -r .version package.json cp ../README.md README.md npx vsce package -o go-0.0.0.vsix --baseContentUrl https://github.com/golang/vscode-go/raw/v0.0.0 --baseImagesUrl https://github.com/golang/vscode-go/raw/v0.0.0 --no-update-package-json --no-git-tag-version 0.0.0
vscode-go/extension/tools/release/testdata/package-v0.0.0.golden/0
{ "file_path": "vscode-go/extension/tools/release/testdata/package-v0.0.0.golden", "repo_id": "vscode-go", "token_count": 117 }
780