Re: [go-nuts] What exactly is a method set?

2019-01-20 Thread Paul Jolly
Have you see the Go Spec? https://golang.org/ref/spec#Method_sets On Sun, 20 Jan 2019 at 12:37, 伊藤和也 wrote: > > What exactly is a method set? > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop

[go-nuts] What exactly is a method set?

2019-01-20 Thread 伊藤和也
What exactly is a method set? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit

[go-nuts] Re: GO lang not able to decrypt the xor-base64 text

2019-01-20 Thread Pat Farrell
On Sunday, January 20, 2019 at 10:14:05 AM UTC-5, Soorya Prakash wrote: > > > I am using the below code to encrypt and decrypt the data. Now I want to > encrypt the data from Node JS and want to decrypt the data from Go lang. > use -1 as the key to debug. once that works, use zero as the key.

Re: [go-nuts] GO lang not able to decrypt the xor-base64 text

2019-01-20 Thread Jan Mercl
On Sun, Jan 20, 2019 at 4:13 PM Soorya Prakash wrote: > for i := range input { > output += string(input[i] ^ key[i%len(key)]) > } BTW, that's O(n^2). -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] Re: What exactly is a method set?

2019-01-20 Thread 伊藤和也
Yes I did. Can I say a method set is the one which associates an interface with methods? 2019年1月20日日曜日 21時37分23秒 UTC+9 伊藤和也: > > What exactly is a method set? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

[go-nuts] Re: C program calling a buildmode=c-shared shared object, which calls a plugin.

2019-01-20 Thread james . ronaldo . second
I have the same problem with latest version (1.11.4). I've been trying to use two shared objects A and B (with c-shared build mode), and use my C++ program to pass the functions exported by A to B through GoInterface parameters. However, in B the type assertion from GoInterface failed... Any

Re: [go-nuts] Re: Why is this an assignment count mismatch?

2019-01-20 Thread roychowdhuryrohit . dev
It can be verified by use of tuples x, (y, z) := A[id1], B[id2] But the above doesn't work. Why ? On Monday, June 6, 2011 at 11:13:04 PM UTC+5:30, soapboxcicero wrote: > > var A, B map[something]bool > ... > x, y, z := A[id1], B[id2] > > is y the value of B[id2] and z whether it's in B or is y

[go-nuts] GO lang not able to decrypt the xor-base64 text

2019-01-20 Thread Soorya Prakash
I am using the below code to encrypt and decrypt the data. Now I want to encrypt the data from Node JS and want to decrypt the data from Go lang. But I am not able to achieve it using GO lang. var B64XorCipher = { encode: function(key, data) { return new Buffer(xorStrings(key,

[go-nuts] Re: What exactly is a method set?

2019-01-20 Thread jake6502
On Sunday, January 20, 2019 at 7:56:39 AM UTC-5, 伊藤和也 wrote: > > Yes I did. Can I say a method set is the one which associates an interface > with methods? > Almost. The method set *of an interface* is the set of methods in the interface. But other types, aside from interfaces, also have

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-20 Thread Tycho Andersen
On Sun, Jan 20, 2019 at 11:18:38AM -0800, Jinwoo Lee wrote: > It looks like "go build ./cmd/..." works when there's only one directory > under cmd. When there are multiple directories there, the command doesn't > generate any binaries for me. > > I would just do > > $ go build ./cmd/foo > $ go

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-20 Thread Jinwoo Lee
It looks like "go build ./cmd/..." works when there's only one directory under cmd. When there are multiple directories there, the command doesn't generate any binaries for me. I would just do $ go build ./cmd/foo $ go build ./cmd/bar They create binaries in the current directory so you don't

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-20 Thread Jinwoo Lee
On Sun, Jan 20, 2019 at 11:33 AM Jan Mercl <0xj...@gmail.com> wrote: > > > > On Sun, Jan 20, 2019 at 8:22 PM Jinwoo Lee wrote: > > > It looks like "go build ./cmd/..." works when there's only one directory > under cmd. When there are multiple directories there, the command doesn't > generate any

[go-nuts] could functions returning multiple values make templates behind the scenes

2019-01-20 Thread 'simon place' via golang-nuts
wouldn't the compiler be able to use the fact that a return value is known not to be being used in a particular call, somewhere one or more of the returned values are assigned to a blank, to be able to generate faster code for that call? or is it already being done? because, it seems to me,

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-20 Thread Jinwoo Lee
On Sun, Jan 20, 2019 at 11:20 AM Tycho Andersen wrote: > On Sun, Jan 20, 2019 at 11:18:38AM -0800, Jinwoo Lee wrote: > > It looks like "go build ./cmd/..." works when there's only one directory > > under cmd. When there are multiple directories there, the command doesn't > > generate any

Re: [go-nuts] What is nil pointer dereference?

2019-01-20 Thread Burak Serdar
On Sun, Jan 20, 2019 at 2:32 PM 伊藤和也 wrote: > > type a interface{ >m() > } > > type abc int > func (abc) m() {} > > func main() { >var v a >v.m() ^^ v is nil. It is declared but never assigned a value. You are dereferencing v to call m, causing nil ptr dereference. > } > >

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-20 Thread Jan Mercl
On Sun, Jan 20, 2019 at 8:22 PM Jinwoo Lee wrote: > It looks like "go build ./cmd/..." works when there's only one directory under cmd. When there are multiple directories there, the command doesn't generate any binaries for me. It works on all sub directories. But `go build` puts the binary

[go-nuts] What is nil pointer dereference?

2019-01-20 Thread 伊藤和也
type a interface{ m() } type abc int func (abc) m() {} func main() { var v a v.m() } panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc005 code=0x0 addr=0x0 pc=0x44e236] -- You received this message because you are subscribed to the Google

[go-nuts] What does "nil implay?

2019-01-20 Thread 伊藤和也
I know "nil" is zero values for slices, maps, interfaces, etc but I don't know what "nil" implays. Does nil implay the absence of value or a variable has't been initialized yet or something else? -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] What does "nil implay?

2019-01-20 Thread David Riley
On Jan 20, 2019, at 18:00, 伊藤和也 wrote: > > I know "nil" is zero values for slices, maps, interfaces, etc but I don't > know what "nil" implays. Does nil implay the absence of value or a variable > has't been initialized yet or something else? Basically yes, all of the above. This pattern

Re: [go-nuts] GO lang not able to decrypt the xor-base64 text

2019-01-20 Thread Christian Staffa
Hi I guess the problem is the range over the input. if you have utf8 runes > 1byte in your input, you are not iterating with over each byte anymore. the i is the index of a encoded rune the string., right? Sent from my iPhone > On 19. Jan 2019, at 13:53, Soorya Prakash wrote: > > > I am

[go-nuts] Obtaining compiled module information at run time

2019-01-20 Thread Maxim Khitrov
I was working on a tool that needed to know the file system paths and version information of some of its dependencies from go.mod for code generation. I couldn't find any official way of obtaining these (debug/gosym was close, but didn't work for the current binary on any OS), so I wrote this

Re: [go-nuts] What is nil pointer dereference?

2019-01-20 Thread David Riley
On Jan 20, 2019, at 16:36, Burak Serdar wrote: > >> On Sun, Jan 20, 2019 at 2:32 PM 伊藤和也 wrote: >> >> type a interface{ >> m() >> } >> >> type abc int >> func (abc) m() {} >> >> func main() { >> var v a >> v.m() >^^ > > v is nil. It is declared but never assigned a value. You

[go-nuts] Is the type of a variable with interface{} "nil"?

2019-01-20 Thread 伊藤和也
I checked the type of the variable "v" with interface{} using TypeOf function in reflect package but it returned "nil". var v interface{} fmt.Println(reflect.TypeOf(v)) Process finished with exit code 0 -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Is the type of a variable with interface{} "nil"?

2019-01-20 Thread Sam Whited
On Mon, Jan 21, 2019, at 00:39, 伊藤和也 wrote: > I checked the type of the variable "v" with interface{} using TypeOf > function in reflect package but it returned "nil". > var v interface{} > fmt.Println(reflect.TypeOf(v)) > That is what the reflect.TypeOf function is supposed to do. The docs

[go-nuts] Gonum user survey

2019-01-20 Thread Sebastien Binet
The Gonum project would like to hear what you think to help us improve the project. We are conducting a user survey to understand user preferences and to guide the future of the project. Please help us understand how to develop the code and the community by participating in the survey by 28

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-20 Thread Jakob Borg
On 20 Jan 2019, at 20:20, Tycho Andersen mailto:ty...@tycho.ws>> wrote: That's how I have it now. The problem with this is that in the face of modules, it re-writes the go.mod and go.sum files to not include the deps of the binary it's not currently building, so you end up with a bunch of