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/tools/playground: type *rsa.PrivateKey has no field or method Public #9678

Closed
s-mang opened this issue Jan 24, 2015 · 5 comments
Closed

x/tools/playground: type *rsa.PrivateKey has no field or method Public #9678

s-mang opened this issue Jan 24, 2015 · 5 comments

Comments

@s-mang
Copy link
Contributor

s-mang commented Jan 24, 2015

  1. What version of Go are you using (go version)?

    • Playground Go version: fmt.Println(runtime.Version()) => go1.3.2
    • Docs Go version (found in footer): go1.4.1
  2. What operating system and processor architecture are you using?

    • Go playground
  3. What did you do?

    private, err := rsa.GenerateKey(rand.Reader, 256)
    if err != nil {
      panic(err.Error())
    }
    public := private.Public() // this line
  4. What did you expect to see?

  5. What did you see instead?
    It does not compile. Exits with: private.Public undefined (type *rsa.PrivateKey has no field or method Public)

@s-mang
Copy link
Contributor Author

s-mang commented Jan 24, 2015

playground: http://play.golang.org/p/sxxL-6F9ed

@mikioh mikioh changed the title Go playground: type *rsa.PrivateKey has no field or method Public playground: type *rsa.PrivateKey has no field or method Public Jan 24, 2015
@cespare
Copy link
Contributor

cespare commented Jan 24, 2015

As you noted, the playground is running Go 1.3.2 while the docs are for 1.4.1.

In Go 1.4, rsa.PrivateKey had the Public method added so that it could satisfy the crypto.Signer interface. (See the release notes.) But you can just access key.PublicKey directly prior to 1.4 if you need that.

@s-mang
Copy link
Contributor Author

s-mang commented Jan 24, 2015

Awesome! Thanks for the quick response.

Just so I know, how soon after a go release is the playground go usually updated?

@adg
Copy link
Contributor

adg commented Jan 24, 2015

We're in the process of replacing the old playground infrastructure with
new stuff, which is almost ready. Once it is finally done we'll update the
playground.

On 24 January 2015 at 13:07, Sarah Adams notifications@github.com wrote:

Awesome! Thanks for the quick response.

Just so I know, how soon after a go release is the playground go usually
updated?


Reply to this email directly or view it on GitHub
#9678 (comment).

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title playground: type *rsa.PrivateKey has no field or method Public x/playground: type *rsa.PrivateKey has no field or method Public Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@ucirello
Copy link
Contributor

This can be closed. it works now.

Check it at http://play.golang.org/p/fMfYsY_JJw

@mikioh mikioh changed the title x/playground: type *rsa.PrivateKey has no field or method Public x/tools/playground: type *rsa.PrivateKey has no field or method Public Jun 27, 2015
@golang golang locked and limited conversation to collaborators Jun 27, 2016
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