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

why not go deduce type #30581

Closed
678uhb opened this issue Mar 4, 2019 · 2 comments
Closed

why not go deduce type #30581

678uhb opened this issue Mar 4, 2019 · 2 comments

Comments

@678uhb
Copy link

678uhb commented Mar 4, 2019

type AStructWithLongName struct {
	data int
}
type AnotherStructWithLongName struct {
	aStructWithLongName AStructWithLongName
	data                int
}
...
a := AnotherStructWithLongName{
		data:                1,
		aStructWithLongName: AStructWithLongName{data: 2},
	}

i have to write a lot lot code like above, is it possible not to write struct name, like int , string etc
like this

a := AnotherStructWithLongName{
		data:                1,
		aStructWithLongName: /*AStructWithLongName*/{data: 2},
	}
@acln0
Copy link
Contributor

acln0 commented Mar 4, 2019

See #21496 and #12854 for more discussion on the topic.

@ianlancetaylor
Copy link
Contributor

Closing as dup.

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

4 participants