Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tour: instructions on how to install gotour #9976

Closed
ghost opened this issue Feb 24, 2015 · 8 comments
Closed

x/tour: instructions on how to install gotour #9976

ghost opened this issue Feb 24, 2015 · 8 comments

Comments

@ghost
Copy link

ghost commented Feb 24, 2015

there are basically no instructions on how to install the gotour locally, it is confusing
I had to read http://golang.org/doc/code.html#remote to figure it out

a line like this should be enough

go get github.com/golang/tour/gotour

@adg adg changed the title instructions on how to install gotour x/tour: instructions on how to install gotour Feb 24, 2015
@yaojingguo
Copy link
Contributor

go get golang.org/x/tour/gotour is mentioned to install the tour locally in https://github.com/golang/tour/blob/master/README. But it gives the following error:

package golang.org/x/tour/gotour: unrecognized import path "golang.org/x/tour/gotour"

Run go get github.com/golang/tour/gotour gives the following error:

package github.com/golang/tour/gotour
    imports github.com/golang/tour/gotour
    imports github.com/golang/tour/gotour: code in directory /home/jing/code/github/go-tour/src/github.com/golang/tour/gotour expects import "golang.org/x/tour/gotour"

@adg adg self-assigned this Mar 19, 2015
@minux
Copy link
Member

minux commented Mar 19, 2015 via email

@adg
Copy link
Contributor

adg commented Mar 19, 2015

Works for me. I suspect a problem on your end.

@adg adg closed this as completed Mar 19, 2015
@yaojingguo
Copy link
Contributor

I have tried go get golang.org/x/tour/gotour with the use of a VPN. It works now. The reason is that golang.org can't be accessed from China mainland.

@aguegu
Copy link

aguegu commented Nov 5, 2015

activating proxy at shell help to go get

export {http,https,ftp}_proxy='http://127.0.0.1:8118'

@as1ndu
Copy link

as1ndu commented Nov 16, 2015

I have acess to https://golang.org but the error perssists.

@as1ndu
Copy link

as1ndu commented Nov 16, 2015

and when i use github.com/golang/tour/gotour
go get github.com/golang/tour/gotour

i get...........

package golang.org/x/tools/godoc/static: unrecognized import path "golang.org/x/tools/godoc/static"
# cd .; git clone https://go.googlesource.com/tools c:\golang\src\golang.org\x\tools
Cloning into 'c:\golang\src\golang.org\x\tools'...
fatal: unable to access 'https://go.googlesource.com/tools/': Unknown SSL protocol error in connection to go.googlesource.com:443
package golang.org/x/tools/playground/socket: exit status 128
package golang.org/x/tools/present: cannot find package "golang.org/x/tools/present" in any of:
        C:\Go\src\golang.org\x\tools\present (from $GOROOT)
        c:\golang\src\golang.org\x\tools\present (from $GOPATH)
# cd .; git clone https://go.googlesource.com/tour c:\golang\src\golang.org\x\tour
Cloning into 'c:\golang\src\golang.org\x\tour'...
fatal: The remote end hung up unexpectedly
error: RPC failed; result=35, HTTP code = 0
package golang.org/x/tour/pic: exit status 128
package golang.org/x/tour/tree: cannot find package "golang.org/x/tour/tree" in any of:
        C:\Go\src\golang.org\x\tour\tree (from $GOROOT)
        c:\golang\src\golang.org\x\tour\tree (from $GOPATH)
package golang.org/x/tour/wc: cannot find package "golang.org/x/tour/wc" in any of:
        C:\Go\src\golang.org\x\tour\wc (from $GOROOT)
        c:\golang\src\golang.org\x\tour\wc (from $GOPATH) 

@damye
Copy link

damye commented Jun 30, 2016

solution for @yaojingguo's problem:
Run go get github.com/golang/tour/gotour gives the following error:

package github.com/golang/tour/gotour
    imports github.com/golang/tour/gotour
    imports github.com/golang/tour/gotour: code in directory /home/jing/code/github/go-tour/src/github.com/golang/tour/gotour expects import "golang.org/x/tour/gotour"

you need remove the commit by @adg , all: add import comments.
as the import comment is work for go get golang.org/x/tour/gotour, not for go get github.com/golang/tour/gotour.
then, the source code is(for example wc.go):

// Copyright 2011 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 wc

import "fmt"

// Test runs a test suite against f.
func Test(f func(string) map[string]int) {
    ok := true
    for _, c := range testCases {
        got := f(c.in)
        if len(c.want) != len(got) {
            ok = false
        } else {
            for k := range c.want {
                if c.want[k] != got[k] {
                    ok = false
                }
            }
        }
        if !ok {
            fmt.Printf("FAIL\n f(%q) =\n  %#v\n want:\n  %#v",
                c.in, got, c.want)
            break
        }
        fmt.Printf("PASS\n f(%q) = \n  %#v\n", c.in, got)
    }
}

var testCases = []struct {
    in   string
    want map[string]int
}{
    {"I am learning Go!", map[string]int{
        "I": 1, "am": 1, "learning": 1, "Go!": 1,
    }},
    {"The quick brown fox jumped over the lazy dog.", map[string]int{
        "The": 1, "quick": 1, "brown": 1, "fox": 1, "jumped": 1,
        "over": 1, "the": 1, "lazy": 1, "dog.": 1,
    }},
    {"I ate a donut. Then I ate another donut.", map[string]int{
        "I": 2, "ate": 2, "a": 1, "donut.": 2, "Then": 1, "another": 1,
    }},
    {"A man a plan a canal panama.", map[string]int{
        "A": 1, "man": 1, "a": 2, "plan": 1, "canal": 1, "panama.": 1,
    }},
}

@golang golang locked and limited conversation to collaborators Jun 28, 2018
@rsc rsc unassigned adg Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants