From aafae304bfa499c33a429f868fe176d19e2aa133 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 16 Apr 2019 19:54:02 -0700 Subject: [PATCH] Initial --- .devcontainer/Dockerfile | 33 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 12 ++++++++++++ .gitignore | 4 ++++ .vscode/launch.json | 12 ++++++++++++ README.md | 16 +++++++++++++++- hello.go | 10 ++++++++++ 6 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/launch.json create mode 100644 hello.go diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..8e93a6a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,33 @@ +#----------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE in the project root for license information. +#----------------------------------------------------------------------------------------- + +FROM golang:1 + +RUN go get -u -v \ + github.com/mdempsky/gocode \ + github.com/uudashr/gopkgs/cmd/gopkgs \ + github.com/ramya-rao-a/go-outline \ + github.com/acroca/go-symbols \ + golang.org/x/tools/cmd/guru \ + golang.org/x/tools/cmd/gorename \ + github.com/rogpeppe/godef \ + github.com/zmb3/gogetdoc \ + github.com/sqs/goreturns \ + golang.org/x/tools/cmd/goimports \ + golang.org/x/lint/golint \ + github.com/alecthomas/gometalinter \ + honnef.co/go/tools/... \ + github.com/golangci/golangci-lint/cmd/golangci-lint \ + github.com/mgechev/revive \ + github.com/derekparker/delve/cmd/dlv + +# Install git, process tools +RUN apt-get update && apt-get -y install git procps + +# Clean up +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..5565bc1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "name": "Go", + "dockerFile": "Dockerfile", + "extensions": [ + "ms-vscode.go" + ], + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3e759b7..1aae53a 100644 --- a/.gitignore +++ b/.gitignore @@ -328,3 +328,7 @@ ASALocalRun/ # MFractors (Xamarin productivity tool) working folder .mfractor/ + +*.DS_Store + +out \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..164eb25 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,12 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch file", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${file}" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 29f7ebd..d91e459 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ +# Go Sample Project for Visual Studio Remote - Containers -# Contributing +This is a sample project to go along with the "try" quick start for the VS Code Remote - Containers extension. + +Using the sample: + +1. **[Windows]** Disable automatic line ending conversion for Git on the *Windows side* (given Linux and Windows use different line endings). Run: `git config --global core.autocrlf false` +2. Follow the steps at [https://aka.ms/vscode-remote/containers/getting-started](https://aka.ms/vscode-remote/containers/getting-started). +3. Open `hello.go`, edit, launch the program, and try things out! + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us @@ -12,3 +21,8 @@ provided by the bot. You will only need to do this once across all repos using o This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## License + +Copyright © Microsoft Corporation All rights reserved.
+Licensed under the MIT License. See LICENSE in the project root for license information. \ No newline at end of file diff --git a/hello.go b/hello.go new file mode 100644 index 0000000..68bf00b --- /dev/null +++ b/hello.go @@ -0,0 +1,10 @@ +/*---------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See LICENSE in the project root for license information. + *---------------------------------------------------------------------------------------*/ + +package main +import "fmt" +func main() { + fmt.Println("hello world") +} \ No newline at end of file