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

go reflect #24420

Closed
itgeniusshuai opened this issue Mar 16, 2018 · 1 comment
Closed

go reflect #24420

itgeniusshuai opened this issue Mar 16, 2018 · 1 comment

Comments

@itgeniusshuai
Copy link

Please answer these questions before submitting your issue. Thanks!

How I can list all structs and functions by package name, or create a struct instance by struct name,such as
package test
type User struct {
Name string
}
func getStructNameByPackageName(packageName string) []string{
...
}
func createStructInstance(structName string) interface{}{
...
}

  1. call function getStructNameByPackageName("test") we will get result: ['User']
  2. call function createStructInstance("test.User") we will get result: a User instance
    I scan many pages on the web,but most people say cann't do these. If can ,please tell me, thank you very much

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

1.7.3

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

What did you see instead?

@davecheney
Copy link
Contributor

Thank you for raising this issue. Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions. We only use our bug tracker for tracking bugs and tracking proposals going through the Proposal Process.

Please see https://golang.org/wiki/Questions for good places to ask questions.

@golang golang locked and limited conversation to collaborators Mar 16, 2019
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

3 participants