Skip to content

panic: interface conversion: interface is []interface { }, not int #1616

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

Closed
gopherbot opened this issue Mar 17, 2011 · 3 comments
Closed

panic: interface conversion: interface is []interface { }, not int #1616

gopherbot opened this issue Mar 17, 2011 · 3 comments

Comments

@gopherbot
Copy link
Contributor

by rodseth:

What steps will reproduce the problem?
1. Compile and run the attached source file

What is the expected output?
2
6
15
24

What do you see instead?
2
6
15
panic: interface conversion: interface is []interface { }, not int

runtime.panic+0xac /tmp/yaourt-tmp-alexander/aur-go-hg/src/go/src/pkg/runtime/proc.c:1028
    runtime.panic(0x43f420, 0xf84001ed90)
assertE2Tret+0xfb /tmp/yaourt-tmp-alexander/aur-go-hg/src/go/src/pkg/runtime/iface.c:298
    assertE2Tret(0x43d450, 0x440aa0, 0xf8400013a0, 0x7f277b262ed8, 0xf8400013a0, ...)
runtime.assertE2T+0x33
/tmp/yaourt-tmp-alexander/aur-go-hg/src/go/src/pkg/runtime/iface.c:280
    runtime.assertE2T(0x43d450, 0x440aa0, 0xf8400013a0, 0x40743d)
main.Sum+0x88 /home/alexander/goprojects/variadic/variadic.go:20
    main.Sum(0xf8400013b0, 0x100000001, 0x300000003, 0x440aa0, 0xf8400013a0, ...)
main.test4+0x135 /home/alexander/goprojects/variadic/variadic.go:48
    main.test4()
main.main+0x27 /home/alexander/goprojects/variadic/variadic.go:55
    main.main()
runtime.mainstart+0xf
/tmp/yaourt-tmp-alexander/aur-go-hg/src/go/src/pkg/runtime/amd64/asm.s:77
    runtime.mainstart()
runtime.goexit /tmp/yaourt-tmp-alexander/aur-go-hg/src/go/src/pkg/runtime/proc.c:180
    runtime.goexit()
----- goroutine created by -----
_rt0_amd64+0x8e /tmp/yaourt-tmp-alexander/aur-go-hg/src/go/src/pkg/runtime/amd64/asm.s:64

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
64-bit Arch Linux

Which revision are you using?  (hg identify)
revision 7798

Please provide any additional information below.
I experienced this while trying to learn about "variadic".

Go was installed using this Arch Linux package:
http://aur.archlinux.org/packages.php?ID=33695

I also don't understand why uncommenting the Printf stops it from compiling, but that's
beside the point.

Thank you.

Attachments:

  1. variadic.go (917 bytes)
@rsc
Copy link
Contributor

rsc commented Mar 17, 2011

Comment 2:

Status: WorkingAsIntended
use Sum(interfaces...) to pass the slice directly

@rsc
Copy link
Contributor

rsc commented Mar 17, 2011

Comment 3:

Status changed to WorkingAsIntended.

@gopherbot
Copy link
Contributor Author

Comment 4 by rodseth:

Ok. Thank you.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

2 participants