mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
[walkthrough]: add powershell walkthrough (#598)
* add powershell commands * split the semicolon onto two lines instead * split another semicolon onto two lines instead * remove does not work on windows warning * fix powershell typo * fix type in modules enables not supported notification * use start-process instead of start
This commit is contained in:
@@ -22,7 +22,8 @@ The 🦁 says rawr!
|
||||
```console
|
||||
$ git clone https://github.com/athens-artifacts/walkthrough.git
|
||||
$ cd walkthrough
|
||||
$ cmd /C "set GOMODULE111=on && C:\GO\bin\go run ."
|
||||
$ $env:GO111MODULE = "on"
|
||||
$ go run .
|
||||
go: downloading github.com/athens-artifacts/samplelib v1.0.0
|
||||
The 🦁 says rawr!
|
||||
```
|
||||
@@ -37,8 +38,6 @@ how the proxy changes the workflow and the output.
|
||||
Using the most simple installation possible, let's walk through how to use the
|
||||
Athens proxy, and figure out what is happening at each step.
|
||||
|
||||
Note: [Currently, the proxy does not work on Windows](https://github.com/gomods/athens/issues/532).
|
||||
|
||||
Before moving on, let's clear our Go Modules cache so that we can see the proxy
|
||||
in action without any caches populated:
|
||||
|
||||
@@ -47,12 +46,10 @@ in action without any caches populated:
|
||||
sudo rm -fr $(go env GOPATH)/pkg/mod
|
||||
```
|
||||
|
||||
<!--
|
||||
**PowerShell**
|
||||
```powershell
|
||||
rm -recurse -force $(go env GOPATH)\pkg\mod
|
||||
rm -recurse -force "$(go env GOPATH)\pkg\mod"
|
||||
```
|
||||
-->
|
||||
|
||||
Now run the Athens proxy in a background process:
|
||||
|
||||
@@ -67,20 +64,19 @@ $ GO111MODULE=off go run ./cmd/proxy &
|
||||
INFO[0000] Starting application at 127.0.0.1:3000
|
||||
```
|
||||
|
||||
Note: [Building Athens Go Modules enabled is not yet supported](https://github.com/gomods/athens/pull/371), so we have turned it off in the above example.
|
||||
Note: [Building Athens with Go Modules enabled is not yet supported](https://github.com/gomods/athens/pull/371), so we have turned it off in the above example.
|
||||
|
||||
<!--
|
||||
**PowerShell**
|
||||
```console
|
||||
$ mkdir $(go env GOPATH)\src\github.com\gomods
|
||||
$ cd $(go env GOPATH)\src\github.com\gomods
|
||||
$ mkdir "$(go env GOPATH)\src\github.com\gomods"
|
||||
$ cd "$(go env GOPATH)\src\github.com\gomods"
|
||||
$ git clone https://github.com/gomods/athens.git
|
||||
$ cd athens
|
||||
$ start -NoNewWindow go "run .\cmd\proxy"
|
||||
$ $env:GO111MODULE = "off"
|
||||
$ Start-Process -NoNewWindow go "run .\cmd\proxy"
|
||||
[1] 25243
|
||||
INFO[0000] Starting application at 127.0.0.1:3000
|
||||
```
|
||||
-->
|
||||
|
||||
The Athens proxy is now running in the background and is listening for requests
|
||||
from localhost (127.0.0.1) on port 3000.
|
||||
@@ -99,13 +95,11 @@ export GO111MODULE=on
|
||||
export GOPROXY=http://127.0.0.1:3000
|
||||
```
|
||||
|
||||
<!--
|
||||
**PowerShell**
|
||||
```powershell
|
||||
$env:GO111MODULE = "on"
|
||||
$env:GOPROXY = "http://127.0.0.1:3000"
|
||||
```
|
||||
-->
|
||||
|
||||
The `GO111MODULE` environment variable controls the Go Modules feature in Go 1.11 only.
|
||||
Possible values are:
|
||||
|
||||
Reference in New Issue
Block a user