[go-nuts] GCP will lowercase header names from September 30. – I would like to update my code to only send lowercase headers

2019-08-27 Thread martin
te the headers sent as long as the clients are case insensitive? Best, Martin -- 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+uns

[go-nuts] Several issues on macOS Sierra

2016-09-22 Thread martin
Hello, Since upgrading to macOS Sierra, I've stumbled upon a few issues that were not present when using OSX El Capitan. All issues arise when using this package https://github.com/jteeuwen/go-bindata however from my cursory glance there's nothing specific about that code that seems troublesom

[go-nuts] Re: Several issues on macOS Sierra

2016-09-22 Thread martin
Dave you were right, just had to rebuild the binary. On Thursday, September 22, 2016 at 4:48:44 PM UTC-4, Dave Cheney wrote: > > Sierra broke programs compiled with previous versions of Go. You've > probably got an old version of go-bindata in your path, delete that, and > run go install -v gith

[go-nuts] Go 1.22.0: Alpine: go test with coverage works but returns exit status 1

2024-02-07 Thread Martin
I am using the new `golang:1.22.0-alpine3.19` Alpine image to build and test a Golang 1.22.0 application. The test uses coverage like that `go test -v ./... -coverprofile=coverage.out -coverpkg=./internal/... -covermode count`. The test command seems to work fine, but the exit status is 1. The

[go-nuts] Re: Go 1.22.0: Alpine: go test with coverage works but returns exit status 1

2024-02-07 Thread Martin
so this happens with the Alpine based image, but also for the Debian based image as well. On Thursday, February 8, 2024 at 12:43:32 AM UTC+1 Martin wrote: > I am using the new `golang:1.22.0-alpine3.19` Alpine image to build and > test a Golang 1.22.0 application. The test uses coverag

[go-nuts] Re: Go 1.22.0: Alpine: go test with coverage works but returns exit status 1

2024-02-10 Thread Martin
> > % go version > go version go1.22.0 darwin/arm64 > % CVPKG=$(go list ./... | tr '\n' ',') > % go test -coverpkg=${CVPKG} -coverprofile=coverage.out -covermode=count > ./... > (all tests passing) > % echo $? > 0 > On Thursday, February 8, 202

[go-nuts] Re: Go 1.22.0: Alpine: go test with coverage works but returns exit status 1

2024-02-10 Thread Martin
Created a issue based on our discussion: https://github.com/golang/go/issues/65653 On Saturday, February 10, 2024 at 10:49:58 PM UTC+1 Martin wrote: > Hey Aldemar and Thomas, > > thanks for your hints. > > > While trying to upgrade a go package to 1.22.0 today, I ran into thi

Re: [go-nuts] [ANN] fixed point math library

2018-12-01 Thread Anthony Martin
Nigel Tao once said: > Well, there's already context.Context, hash.Hash, image.Image and > time.Time in the standard library. All of which are not great. Better names are context.Frame, hash.Function, raster.Image, and time.Instant. Anthony -- You received this message because you are subscr

[go-nuts] Re: pointer dereference optimization in loops

2018-12-01 Thread Anthony Martin
Mark Volkmann once said: > Suppose myPtr is a pointer and I write code like this: > > for _, v := range values { > fmt.Printf("%v %v\n", *myPtr, v) > } > > Will the Go compiler optimize the pointer dereference so it doesn't happen > in every loop iteration? If not, is it common practice to do th

Re: [go-nuts] [ANN] fixed point math library

2018-12-01 Thread Anthony Martin
A hash function is a mathematical construction. A raster image is a type of graphical representation. A time instant is a single point in a duration. All of these are clear as can be. I'll give you "context frame". It is a bit wonky. A better phrase is out there somewhere. Scope, environment, etc

Re: [go-nuts] parse timestamp in Go

2019-02-08 Thread Martin Schnabel
just for future reference, there is no format for 'this' (the format op asked for). because this format does not have a period. i was just as surprised. you can try yourself: https://play.golang.org/p/wv_PDwTmEOk the documentation also states that you do not specify the fraction seconds for pa

[go-nuts] Re: WebAssembly: Auto-generating Go bindings for javascript/DOM from the Web Standards.

2019-02-24 Thread Martin Juhlin
Hi, I have started to work on DOM binding based on WebIDL and a binding generator. I don't have full WebIDL support yet, but it does process idl from about 80 specifications. See https://gowebapi.github.io for more details. Martin Den fredag 28 december 2018 kl. 13:16:22 UTC+1 skrev

[go-nuts] Announcement: DOM, HTML bindings for Go WASM + binding generator

2019-02-25 Thread Martin Juhlin
the project useful as binding code between go web assembly and javascript should be generated and not manually written :-) Martin -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails fr

Re: [go-nuts] Re: WebAssembly: Auto-generating Go bindings for javascript/DOM from the Web Standards.

2019-02-25 Thread Martin Juhlin
modules. The IDL standard that WebIDL based on however does. It uses C++ like syntax (foo::bar) inside “namespace” block. It’s probably not hard to solve. In the current handwritten library, how is the interaction with JSX solved? It feels like that normal react.js code is compiled. Martin

Re: [go-nuts] email body not showing up

2019-03-21 Thread Martin Tournoij
On Thu, 21 Mar 2019 11:56:21 +0530 pradam wrote: > I have implement below code, but body not showing up, so whats wrong > with the code? > > [..] > > _, err = fmt.Fprintf(wc, "This is the email body") > if err != nil { > log.Fatal(err) > } > > [..] You are not sending any header fields; an e

[go-nuts] "find" for Slices like "append"

2017-08-07 Thread martin . rode
not found Why can I not find easily search for an item inside a Slice. Every other language I know has this. And I need this in a generic form. Or am I missing something entirely here? Best Martin -- You received this message because you are subscribed to the Google Groups "golang-nuts&q

Re: [go-nuts] "find" for Slices like "append"

2017-08-07 Thread martin . rode
hort, but I need to know the type of the items in my Slice. So I need a loop for every datatype!? And I need to name it for each type differently? Why? All I want to be able to do is to find an item in a Slice. Why does "append" work with all types then? Martin -- You receive

Re: [go-nuts] "find" for Slices like "append"

2017-08-07 Thread martin . rode
y..."). I will have a hard time selling this missing feature to my team. Martin > > -- 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

Re: [go-nuts] "find" for Slices like "append"

2017-08-08 Thread martin . rode
Sort.Search is nice, but then the list has to be sorted. Wasnt there a lenghty discussion on how awkward sorting is compared to other languages, and then in 1.8. finally someone implemented func Slice(slice interface{}, less func(i, j int ) bool

Re: [go-nuts] "find" for Slices like "append"

2017-08-08 Thread martin . rode
contains = true } } if !contains { ... Seriously? 2017? Martin > -- > ☕😎 > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] "find" for Slices like "append"

2017-08-09 Thread martin . rode
Volker thanks for the reply. Coming from Python I can do a simple test like if item in my_array: # do something else: # do something else I can understand that it cannot be that easy in Go (and then, why not, "equals" is already defined), but image you have to use a for-loop every time or

[go-nuts] Re: Full Time Job Opportunity at Mattel: Remote inside US OK

2017-08-15 Thread martin . ostrovsky
I'm not interested in the job but just wanted to say this is one of the best job postings I've ever read. On Tuesday, August 15, 2017 at 10:54:22 AM UTC-4, Nate Finch wrote: > > Mattel (yes the toy company) is hiring full time Go devs to work on its > IoT & identity server platform. Remote is O

[go-nuts] error handling needs syntactical sugar

2017-09-04 Thread martin . rode
atched variables I am not a language expert, so may be there is a saner way of expression what I want to achieve. But bottom line is, there should by an easier to read and write way to deal with errors in Go. Martin -- You received this message because you are subscribed to the Google G

[go-nuts] Re: error handling needs syntactical sugar

2017-09-04 Thread martin . rode
On Monday, September 4, 2017 at 10:48:06 PM UTC+2, Tamás Gulácsi wrote: > > Why do you Prepare a statement if you don't reuse it? Just use a db.Exec. Just wanted to show a pattern which I see very often in Go code. Its not a working example, and I am not asking for improvements in that code.

Re: [go-nuts] error handling needs syntactical sugar

2017-09-04 Thread martin . rode
ic & exit after any error. How do you do that, without putting code after each statement or wrapping? You can't. And that's why I am proposing to be a little bit open to new ideas. Every modern language I know of has some sort of try...catch construct. Martin On Monday, Septem

[go-nuts] Re: error handling needs syntactical sugar

2017-09-04 Thread martin . rode
r errors but any other places where new values to get assigned to variables. Martin > >> -- 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 g

Re: [go-nuts] error handling needs syntactical sugar

2017-09-05 Thread martin . rode
ines of code compared to C nor does it help with readability. And, I have another argument against your "I want people to deal with their errors". You cannot force people into too much. That's why you see SOOO much Go code which simply copy & pastes long long chains of "if er

Re: [go-nuts] error handling needs syntactical sugar

2017-09-05 Thread martin . rode
Dorival, thanks for counting your error calls, but without any other number showing the size of your project they cannot really put in perspective ;-) And I think *watch* should not only be function bound, but bound to the current scope, same as *var*. Martin On Tuesday, September 5, 2017

[go-nuts] Re: error handling needs syntactical sugar

2017-09-05 Thread martin . rode
s broken, BTW) func ... { var err watch err != nil { // handle error return } // do stuff yo1, err := do_stuff1() yo2, err := do_stuff2() yo3, err := do_stuff3() } Martin On Tuesday, September 5, 2017 at 9:32:50 AM UTC+2, Dorival Pedroso wrote: > > Hi Martin; > > What about two

Re: [go-nuts] Re: error handling needs syntactical sugar

2017-09-07 Thread martin . rode
yo2, err = do_stuff2() yo3, err = do_stuff3() } then { // handle your error } This statement could be used for other cases as well, it is easy to read and understand, and it saves the programmer from line duplication. Martin -- You received this message because you are subscribed to the Google Groups

[go-nuts] SIGILL: illegal instruction when making cgo call

2017-11-01 Thread martin . ostrovsky
Hello, Encountered this issue running a statically compiled binary that uses cgo (Compiled using go1.8.3). It works OK on one CPU type but not on another. The binary is built on a server which is neither of the two below. Is this a Go issue or something to do with how the C library is built (gc

[go-nuts] Re: Random panic in production with Sprintf

2019-05-02 Thread Anthony Martin
What version of Go are you using? XXX ZZZ once said: > fmt.(*pp).fmtString(0xc023c17740, 0x0, 0x5, 0xc00076) > /usr/local/go/src/fmt/print.go:448 +0x132 > fmt.(*pp).printArg(0xc023c17740, 0x9978e0, 0xc016a68a30, 0x76) > /usr/local/go/src/fmt/print.go:684 +0x880 > fmt.(*pp).doPrintf(0x

Re: [go-nuts] Re: Random panic in production with Sprintf

2019-05-02 Thread Anthony Martin
Ian Lance Taylor once said: > I don't *think* the format string is changing. I think the 0 is from > the string being printed, not the format string. They both happen to > be length 5. Misled by the pair of fives. Mea culpa. Anthony -- You received this message because you are subscribed t

Re: [go-nuts] Interesting public commentary on Go...

2019-05-23 Thread Anthony Martin
Sam Whited once said: > This is especially a problem when these proposals further tie Go to > Google web services run by the Go team (though I'm veering off into a > separate problem here). To me this feels like it's almost a type of > vertical integration and it's an absolutely disgusting thing t

Re: [go-nuts] Go 2 generics counterproposal: giving up restricting types

2019-06-03 Thread Martin Schnabel
for generators and generated code. While nobody can claim to use 'type'. This would make converting code so much easier, if this proposal is accepted. Just a though. Please tell me whether this would be possible. Thanks for your work, it's much appreciated. Martin On 30.05.19 14:08

Re: [go-nuts] Go 2 generics counterproposal: giving up restricting types

2019-06-03 Thread Martin Schnabel
if written as part of the array syntax, as in '[n]elem' does not need an explicit keyword qualifier, because - again - it's unambiguous in the parameter context. Would you agree? Best regards Martin On 03.06.19 14:20, Michal Strba wrote: Hi Martin. The proposal adds types a

Re: [go-nuts] Go 2 generics counterproposal: giving up restricting types

2019-06-03 Thread Martin Schnabel
"gen is not allowed in the return types", which is an important rule. Without qualification, this rule would be hard to express. On Mon, Jun 3, 2019, 15:26 Martin Schnabel <mailto:m...@mb0.org>> wrote: Hi Michal, I would argue that the 'const' keyword w

Re: [go-nuts] Parsing time zone +07:00

2019-07-02 Thread Martin Schnabel
the format time uses a minus sign '-' instead of a plus https://play.golang.org/p/pXDXm0KmwTz have fun! On 02.07.19 20:11, 'Константин Иванов' via golang-nuts wrote: https://play.golang.org/p/4Rr2xVGKnQg | packagemain import( "fmt" "time" ) constin="+03:00"// "2019-07-02T19:28:39.403+03:0

Re: [go-nuts] Citation Needed

2019-07-08 Thread Martin Schnabel
On 06.07.19 08:50, go je wrote: Is the Category "Games" gaining attention in the go community? Are the Developers writing for production level? Do we have an examples? image.png I would guess, that most of respondents using go for game development, use it on the server side. Think multi-, br

Re: [go-nuts] Does invoking a method with an interface variable avoid dependency analysis?

2019-07-08 Thread Martin Schnabel
On 08.07.19 02:51, Il-seob Bae wrote: As per the spec , A reference to a method m is a method value or method expression of the form t.m, where the (static) type of t is not an interface type, and the method m is in the method se

Re: [go-nuts] Does invoking a method with an interface variable avoid dependency analysis?

2019-07-08 Thread Martin Schnabel
sorry. i misunderstood your question. the paragraph you quoted refers to reference to methods values (t.m) or expressions (T.m) and not method calls t.m() as in your example. does that help solve the question? On 08.07.19 20:09, Martin Schnabel wrote: On 08.07.19 02:51, Il-seob Bae wrote: As

Re: [go-nuts] get interface and method name

2019-07-12 Thread Martin Schnabel
Because AccountService.Create is a method expression you can get to the interface type by inspecting its first argument. Then you could check the interface type for all methods and compare the input and output parameters. This however is brittle and only works if you can guarantee that there is no

Re: [go-nuts] Get struct type , save and reconstruct empty struct later

2019-07-20 Thread Martin Schnabel
If you only need any unnamed struct type you can create one with reflect from the field information that you can write to text somewhere. https://godoc.org/reflect#StructOf These unnamed struct types however do not have any methods and do not wrap embedded named type methods. Otherwise

Re: [go-nuts] Regarding strings replace functions issues

2019-08-27 Thread Martin Schnabel
You can use the go playground to share an example. Like this: https://play.golang.org/p/8RJXT-e91T5 As you can see in that example both functions work as expected. We can only guess what the problem might be without a concrete example. One guess would be that your input has not the newline byte

Re: [go-nuts] Regarding strings replace functions issues

2019-08-28 Thread Martin Schnabel
Somewhere in your code producing the text you seem to escape the the escape sequence for the newline character. "\n" is a string with the escape sequence for the newline character '\n' "\\n" is a string with escaped slash and a lowercase n '\\' 'n' Again, without seeing the code we can only gues

Re: [go-nuts] Regarding strings replace functions issues

2019-08-28 Thread Martin Schnabel
. On 28.08.19 13:15, Martin Schnabel wrote: Somewhere in your code producing the text you seem to escape the the escape sequence for the newline character. "\n" is a string with the escape sequence for the newline character '\n' "\\n" is a string with escaped s

[go-nuts] Re: ls: unsupported SSLv2 handshake received

2019-09-18 Thread Anthony Martin
Prabhash Rathore once said: > Looking at comment, it seems Golang does not support SSLv2 and SSLV3. The crypto/tls package can support SSLv3 if you set tls.Config.MinVersion to tls.VersionSSL30, but only as a server. > I am reaching out to see if there is anyway possible to add support for > ol

[go-nuts] JWT validation only in Middleware

2019-09-26 Thread Martin Palma
WT in the next handler without validating it again and using the claims? Best, Martin -- 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 golan

Re: [go-nuts] JWT validation only in Middleware

2019-09-27 Thread Martin Palma
rote: > On Thu, Sep 26, 2019 at 1:14 PM Martin Palma wrote: > > > > Hello, > > > > I'm in the process of writing an HTTP API with Go. I use a middleware > for generating and validating JWT tokens. On any incoming request the > middleware checks the JWT and v

[go-nuts] Interface method return other interface?

2019-10-09 Thread Martin Palma
I'm wondering If it is ok (or good Go code) if an interface method returns an other interface? Here an example: type Querier interface { Query() string } type Decoder interface { DecodeAndValidate() Querier } -- You received this message because you are subscribed to the Google Groups "gol

Re: [go-nuts] Interface method return other interface?

2019-10-10 Thread Martin Palma
). > > > > > > There is one point you need to remember when returning interfaces: > > make sure you handle nil correctly: > > > > type S struct {} > > > > type I interface {} > > > > func f() *S { > > return nil > > } > >

[go-nuts] Re: [security] Go 1.13.2 and Go 1.12.11 are released

2019-10-18 Thread Anthony Martin
Katie Hockman once said: > The Go 1.13.2 release also includes a fix to the compiler that prevents > improper access to negative slice indexes in rare cases. Affected code, in > which the compiler can prove that the index is zero or negative, would have > resulted in a panic in Go 1.12.11, but cou

[go-nuts] Re: mutual TLS authentication (sometimes)

2019-11-20 Thread Anthony Martin
Matthew Zimmerman once said: > I've also thought about authenticating on a different domain name > auth.service then redirecting to data.service or something like that where > the cookie would be issued to the *.service domain, however that's still > one tls.Config and using SNI with tls.Config.Ge

Re: [go-nuts] Weird slice of struct

2019-12-04 Thread Martin Schnabel
On 04.12.19 22:40, cstige...@gmail.com wrote: Hello Golang nuts group. I've tested golang's slice and got a weird result. Anyone can explain it? the variable ss in the for range loop is one and the same variable, with a different value of AA for each iteration. it has only one address. a

Re: [go-nuts] runtime: split stack overflow

2016-08-26 Thread martin . strenge
ther thread to discuss the "correct way" to create a crash dump file for Go and C, and discuss my experiments. I'll leave this thread for the signal handler replacement on Darwin. Thanks! Martin -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] runtime: split stack overflow

2016-08-26 Thread martin . strenge
__sigaction { union __sigaction_u __sigaction_u; /* signal handler */ void (*sa_tramp)(void *, int, int, siginfo_t *, void *); sigset_t sa_mask; /* signal mask to apply */ int sa_flags; /* see signal options below */ }; Martin -- You received this message because you are subscribed to t

Re: [go-nuts] runtime: split stack overflow

2016-08-29 Thread martin . strenge
of using the default one and do it like in Linux? > And presumably not > calling sigreturn. > ... and save all registers in plan9 sigtramp functions. I'll open an issue. Thanks, Martin -- You received this message because you are subscribed to the Google Groups "golang-n

Re: [go-nuts] runtime: split stack overflow

2016-08-29 Thread martin . strenge
y the sigfwdgo() function as plan9 does not have the same register saving rules. Martin -- 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+unsu

[go-nuts] Creating a crash dump file with Go and C stack traces

2016-08-30 Thread martin . strenge
ed modules/libraries or environment variables. I can imagine that it's easier said than done, but that's what I would prefer. Thanks for your opinions! Martin -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fro

Re: [go-nuts] cgo and OSX "main thread"

2016-09-09 Thread Martin Bertschler
There is also a great wiki article on how to execute functions on the main thread from multiple goroutines. It helped me a lot when I did some GUI development experiments. https://github.com/golang/go/wiki/LockOSThread -- You received this message because you are subscribed to the Google Groups

[go-nuts] Idea for versioning in the new Go package manager.

2016-10-26 Thread Martin Bertschler
not be hard because we already have things like https://golang.org/cmd/api/. The full specification on how Elm handles that can be found here: https://github.com/elm-lang/elm-package. What are your thoughts on this matter? Best, Martin -- You received this message because you are subscribed to

[go-nuts] Oxymoron: language spec: ``untyped boolean value''

2016-11-02 Thread Martin Steffen
that? If ok behaves like a boolean, why is it considered as untyped? Martin -- 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

Re: [go-nuts] Oxymoron: language spec: ``untyped boolean value''

2016-11-02 Thread Martin Steffen
l > var n int > var ok A > n, ok = x.(int) > > Using bool here is not common, but you see this with int and float, etc. > Untyped constants is one of the most prominent Go features. > > On Nov 2, 2016, at 4:09 AM, Martin Steffen > wrote: > > Hi, in the language spec, e.

Re: [go-nuts] Oxymoron: language spec: ``untyped boolean value''

2016-11-02 Thread Martin Steffen
ion. But it's a really a terminology question. I only can't imagine explaining it to students: ``remember, true is untyped, but it can only be used as if it had type bool''. On Wednesday, November 2, 2016 at 2:34:56 PM UTC+1, Ian Lance Taylor wrote: > > On W

Re: [go-nuts] Shuffle Items in a Slice

2016-06-24 Thread Martin Geisler
ate indexes into the map. Use these indexes to swap elements and permute the array as Konstantin mentioned (https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). -- Martin Geisler -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscr

Re: [go-nuts] Append to slice... what happens?

2016-06-26 Thread Martin Geisler
in b. In your example you were "lucky" since you started with a = [1, 2] and cap(a) = 2. When you create b, append notices that the capacity is exhausted and *creates a new underlying array for b*. After that step, a and b are no longer "entangled" like this and updates to one c

Re: [go-nuts] Append to slice... what happens?

2016-06-26 Thread Martin Geisler
to me since the second (middle) index has a useful default (len(a)) that is used when there are only two indexes used. -- Martin Geisler -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] Re: Shuffle Items in a Slice

2016-06-26 Thread Martin Geisler
Hi Val On Fri, Jun 24, 2016 at 2:48 PM, Val wrote: > 2 implementations here : > http://www.programming-idioms.org/idiom/10/shuffle-a-list/1564/go > > As for the map iteration trick, the runtime doesn't guarantee to randomize > anything, although it often tries to, so developers don't rely on some

Re: [go-nuts] Shuffle Items in a Slice

2016-06-26 Thread Martin Geisler
e point in the past : the > clock, the randomness sources, and you can't make outgoing requests to > import randomness from the network. I found this blog post with a lot more background information: https://blog.golang.org/playground -- Martin Geisler -- You received thi

Re: [go-nuts] Append to slice... what happens?

2016-07-01 Thread Martin Geisler
Hi Ian, On Mon, Jun 27, 2016 at 8:18 PM, Ian Lance Taylor wrote: > On Sun, Jun 26, 2016 at 10:55 PM, Dan Kortschak > wrote: >> On Mon, 2016-06-27 at 07:49 +0200, Martin Geisler wrote: >>> BTW, I was about to say that you could simplify the line one step >>> furthe

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-01 Thread Martin Geisler
strings can. Two strings (that are not slices from the same original string) can be compared for equality just fine. I hope Go takes the shortcut when the strings refer to the same memory and otherwise does the slower per-byte comparison. The same could perhaps apply to slices in general. -- Martin

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-01 Thread Martin Geisler
On Fri, Jul 1, 2016 at 12:48 PM, Chad wrote: > On Friday, July 1, 2016 at 12:11:43 PM UTC+2, Martin Geisler wrote: >> >> On Fri, Jul 1, 2016 at 3:15 AM, Chad wrote: >> > No, it's actually fine. You are comparing values. >> > >> > A slice bein

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-01 Thread Martin Geisler
x27;s similarly sized. I'm very new to Go, so please let me know if I'm missing anything? -- Martin Geisler -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving email

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-02 Thread Martin Geisler
On Fri, Jul 1, 2016 at 4:01 PM, Chad wrote: > > > On Friday, July 1, 2016 at 3:44:10 PM UTC+2, Martin Geisler wrote: >> >> On Fri, Jul 1, 2016 at 12:52 PM, Chad wrote: >> > However, that it's a valid point you raise (re strings) >> > But that&#

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-02 Thread Martin Geisler
and the kind of optimization the compiler can do when it knows the implementation of map and string. However, it shouldn't be part of the language specification. -- Martin Geisler -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-03 Thread Martin Geisler
Hi Chad, On Sat, Jul 2, 2016 at 10:43 AM, Chad wrote: > > On Saturday, July 2, 2016 at 10:23:04 AM UTC+2, Martin Geisler wrote: >> >> On Fri, Jul 1, 2016 at 4:01 PM, Chad wrote: >>> >>> On Friday, July 1, 2016 at 3:44:10 PM UTC+2, Martin Geisler wrote: >

Re: [go-nuts] Re: Append to slice... what happens?

2016-07-03 Thread Martin Geisler
much more room there is beyond the length. If you set the capacity to the length, the next call to append will conclude that there's no space in the underlying array and proceed to allocate a new array, copy the data from the slide to the new array, and return a slice into this new array.

Re: [go-nuts] Error vs. Panic: Should functions like strings.Repeat return an error value?

2016-07-07 Thread Martin Geisler
s the ideomatic and good way in Go. That's very strange to me, and from reading about Go around the net, strange to a lot of people. -- Martin Geisler -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

Re: [go-nuts] Error vs. Panic: Should functions like strings.Repeat return an error value?

2016-07-07 Thread Martin Geisler
On Thu, Jul 7, 2016 at 9:44 AM, Dave Cheney wrote: > Hi Martin, > > Go doesn't have exceptions, it really doesn't. Some people like to pretend > that panic/recover are exceptions, but really they are not [1]. Yes, sure, they're called something else :-) But they be

Re: [go-nuts] parse.ParseExpr("var a = 9") returns error "expected operand, found 'var'"

2016-08-11 Thread Martin Schnabel
On Do, 2016-08-11 at 03:55 -0700, Jason E. Aten wrote: > I'm trying to use parser.ParseExpr. I'm thinking "var a = 9" is a > valid expression, but ParseExpr returns an error: > hi jason,  a variable declaration is a statement and not an expression. when in question on this matters take a look at

Re: [go-nuts] parse.ParseExpr("var a = 9") returns error "expected operand, found 'var'"

2016-08-11 Thread Martin Schnabel
> Pedantically, perhaps this is a statement rather than an expression. > That begs the question, is there anyway to parse single statements > (using go/parse)? >  sorry haven't read the whole email. just write your own. use a simple package file skeleton and use ParseFile. -- You received this m

[go-nuts] runtime: split stack overflow

2016-08-18 Thread martin . strenge
Hi, i'm trying to replace a Go signal handler by a C signal handler and try to call the stored Go handler inside that C handler. It works well on Linux, but on Darwin I receive a "runtime: split stack overflow" exception. Is that supposed to work on OSX? Thanks! Martin

Re: [go-nuts] runtime: split stack overflow

2016-08-19 Thread martin . strenge
a signal raised in Go, I register the C handlers after the Go handlers. And instead of raising the signal again, I call the Go handler directly to keep the original mcontext. Do you think there's a better way to do it? Thanks! Martin -- You received this message because you are su

[go-nuts] Practical Golang: Building a simple, distributed one-value database with Hashicorp Serf

2017-01-30 Thread Jacob Martin
A tutorial to build a simple distributed one-value database (as the title sais): https://jacobmartins.com/2017/01/29/practical-golang-building-a-simple-distributed-one-value-database-with-hashicorp-serf/ Please comment with feedback! -- You received this message because you are subscribed to th

[go-nuts] Wrestling with Mingw64 on Windows

2017-01-30 Thread Jacob Martin
I'd advice you to use bash on Ubuntu on windows to compile cgo programs on windows. It's easy to use and works. -- 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 g

[go-nuts] Appending a path to an URL

2017-01-31 Thread Martin Gallagher
Is this what you want: https://play.golang.org/p/BW96Bk_sqJ -- 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 opt

[go-nuts] Appending a path to an URL

2017-01-31 Thread Martin Gallagher
Is this what you want: https://play.golang.org/p/BW96Bk_sqJ -- 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 opt

Re: [go-nuts] Why does my program hang?

2017-02-26 Thread Martin Schnabel
> i-- by decrementing i in the case of i > 0 and a non graphic rune you run the loop possibly indefinitely -- 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 gola

Re: [go-nuts] Why does my program hang?

2017-02-26 Thread Martin Schnabel
big.NewInt(int64(unsafe.Sizeof(char also this line will will define the maximum of the random number which is 4. so all the random runes are 0 <= r <= 4 which are all not graphic. is this more what you expect https://play.golang.org/p/61hzuNj1nF it uses append instead of the decrementing

Re: [go-nuts] Re: Gracefully Shutdown File Server

2017-03-14 Thread Martin Schnabel
i looked into the issue and it seems the problem is the early exit from the program. this should work https://play.golang.org/p/LdXUYyzDxY On 14.03.2017 06:30, amk...@gmail.com wrote: Maybe this is a bug or need clear documentation about this. I've filed a bug report here: https://github.com/g

[go-nuts] Issue building binaries using cgo on macOS Sierra 10.12.4

2017-03-28 Thread martin . ostrovsky
Hello, Upgraded my mac to 10.12.4 yesterday, tried to run a binary built using go1.8. I immediately get Killed: 9 as output. The binary includes many C/C++ libraries via cgo but everything was fine under 10.12.3 I then built the binary using -ldflags -s and that was OK. I saw a similar issue

[go-nuts] How to point to pointer struct

2017-05-23 Thread alex martin
Hi I have this structure in C created by rsl libray typedef struct { Radar_header h; Volume **v; } Radar; Using cgo i read the structure with Radar *readRad(char *fname) { return RSL_anyformat_to_radar(fname, NULL); } and call this function in go RPointer := C.readRad(C.CSt

[go-nuts] Re: How to point to pointer struct

2017-05-23 Thread alex martin
g that might be useful: > https://stackoverflow.com/questions/36188649/cgo-char-to-slice-string > > > > On Tuesday, May 23, 2017 at 8:39:12 PM UTC+10, alex martin wrote: >> >> Hi >> I have this structure in C created by rsl libray >> >> typedef struct { >&g

Re: [go-nuts] Installing a package

2017-07-02 Thread Martin Spasov
Does that mean that it is not possible to chose where you want to install the pkg ? On Mon, Jul 3, 2017 at 12:00 AM, Matt Harden wrote: I believe it's the first folder in GOPATH, not the last. On Sun, Jul 2, 2017 at 1:21 PM wrote: From what I found here when you install packages with go get,

Re: [go-nuts] Installing a package

2017-07-02 Thread Martin Spasov
pkg install location. On Mon, Jul 3, 2017, 9:02 AM Martin Spasov wrote: Does that mean that it is not possible to chose where you want to install the pkg ? On Mon, Jul 3, 2017 at 12:00 AM, Matt Harden wrote: I believe it's the first folder in GOPATH, not the last. On Sun, Jul 2, 2017 at

Re: [go-nuts] Go install recreates .a files that are already present in the pkg directory

2017-07-14 Thread Martin Spasov
I am getting *build ID mismatch* and here I see that it means that something has changed in the package, but I have not modified it in any way. Below is the whole application : package main import ( "os" "github.com/gotk3/gotk3/gtk" ) f

Re: [go-nuts] Go install recreates .a files that are already present in the pkg directory

2017-07-14 Thread Martin Spasov
I am getting *build ID mismatch* and here I see that it means that something has changed in the package, but I have not modified it in any way. Below is the whole application : package main import ( "os" "github.com/gotk3/gotk3/gtk" ) f

Re: [go-nuts] Weird benchmark results for seemingly identical functions

2020-06-22 Thread Martin Schnabel
Let me quickly point out that your logic is inverted in the second code snippet because you break on the condition. That is most likely the reason for the difference. I guess the second example exits on the first iteration. for pos := 0; true; pos++ { if pos < suffixLen && pos < previousSuf

[go-nuts] [generics] Trying to use generics as enums

2020-07-05 Thread Martin Tournoij
2go" playground today. Note I am not usually subscribed to the golang-nuts mailing list, and have not read all of the discussions (using Google groups to browse archives is a but of a pain), so apologies if this duplicates any previous feedback. Hope it helps. Cheerio, Martin --- First, l

Re: [go-nuts] Busy synchronization wait seems to behave differently on 1.13 and 1.14

2020-07-25 Thread Martin Schnabel
I am not certain but the reason probably is the change to go-routine preemption in 1.14. From https://golang.org/doc/go1.14#runtime … Goroutines are now asynchronously preemptible. As a result, loops without function calls no longer potentially deadlock the scheduler or significantly delay gar

  1   2   >