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

Getting started documentation broken #59

Closed
jzs opened this issue May 18, 2017 · 3 comments
Closed

Getting started documentation broken #59

jzs opened this issue May 18, 2017 · 3 comments
Assignees

Comments

@jzs
Copy link

jzs commented May 18, 2017

The code examples on: https://www.stellar.org/developers/guides/get-started/create-account.html are broken.

Let's take the first one as an example:

package main

import (
	"log"

	"github.com/stellar/go/keypair"
)

func main() {
	pair, err := keypair.Random()
	if err != nil {
		log.Fatal(err)
	}

	log.Println(pair.secret())
	// SAV76USXIJOBMEQXPANUOQM6F5LIOTLPDIDVRJBFFE2MDJXG24TAPUU7
	log.Println(pair.Address())
	// GCFXHS4GXL6BVUCXBWXGTITROWLVYXQKQLF4YH5O5JT3YZXCYPAFBJZB
}

I don't think it has ever worked as pair.secret is not an exposed method. On top of that there's no function anymore called secret. pair.Seed() maybe?

The second example has broken imports (http which should be net/http) and expects code from the first example (pair.Address()) to be present. At last fmt.Println(body) does not make much sense. Maybe a fmt.Println(string(body)) would suffice here.
I suggest either remove the imports and main? or show a fully working example?

I haven't ran more examples through yet, but i have a feeling there's more broken stuff.

Besides, adding comments to exposed methods/functions is always a nice bonus ;-)

➜  github.com/stellar/go/keypair git:(master) ✗ golint
from_address.go:19:1: exported method FromAddress.Address should have comment or be unexported
from_address.go:23:1: exported method FromAddress.Hint should have comment or be unexported
from_address.go:28:1: exported method FromAddress.Verify should have comment or be unexported
from_address.go:42:1: exported method FromAddress.Sign should have comment or be unexported
from_address.go:46:1: exported method FromAddress.SignDecorated should have comment or be unexported
full.go:11:6: exported type Full should have comment or be unexported
full.go:15:1: exported method Full.Address should have comment or be unexported
full.go:19:1: exported method Full.Hint should have comment or be unexported
full.go:24:1: exported method Full.Seed should have comment or be unexported
full.go:28:1: exported method Full.Verify should have comment or be unexported
full.go:42:1: exported method Full.Sign should have comment or be unexported
full.go:47:1: exported method Full.SignDecorated should have comment or be unexported

About the lint messages, i could do a pull request on that, once i have read up a bit more on the stellar documentation :)

@jzs
Copy link
Author

jzs commented May 20, 2017

Gonna close this one and make some pull requests instead.

@jedmccaleb
Copy link
Contributor

Thanks jzs. I'm going to leave it open though. normally we close it in the PR that fixes the issue. I'll mark as that you are doing it so we know :)

@jedmccaleb
Copy link
Contributor

oh I see you already made the PR. awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants