I disagree with error handling proposals that hide the program flow's
branching statements.
In 1976, Thomas McCabe found a correlation between branching statements and
bugs. His cyclomatic complexity uses program flow to measure code
complexity. It is important that branching statements be pla
It's, where trying to run Binary
-Linux version 2.6.18
-Red Hat Enterprise Linux Server release 5.11
Jenkins, where Binary generated
-RHEL 7.8
-Linux 3.10.0
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and s
On Tue, Aug 4, 2020 at 9:31 PM Ravi Kant Soni wrote:
> Binary generated in Linux 3.10.0
>
> And Running in 2.6.18
>
What was the Linux distro and kernel version of the system on which you
attempted to run the binary?
--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
You
Binary generated in Linux 3.10.0
And Running in 2.6.18
--
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.
To view this dis
The operator support is what makes things so complicated. Why not define a
“numeric” type that has methods for all the operators that is used with
generics, similar to Number in Java. Then it is unified. If you are writing
specialized math performant code you would probably use concrete types an
On Tue, Aug 4, 2020 at 7:31 PM Ben Hoyt wrote:
>
> > Yes, I think that the ability to write generics using operators is not
> > optional. As I've said before, there are some functions that must be
> > possible to write using any plausible generics mechanism. One of them
> > is the Min function t
> Yes, I think that the ability to write generics using operators is not
> optional. As I've said before, there are some functions that must be
> possible to write using any plausible generics mechanism. One of them
> is the Min function that returns the smaller of two values of some
> ordered ty
Hello, list.
I had a goal, which was to use surf as a dedicated browser that lives on
the same desktop as my terminal emulator in which I vim. I wanted to
have this dedicated browser as a spot to browse godoc on-demand as a
result of triggering go-doc-browser in vim-go.
I wanted to be sure that s
On Mon, Aug 3, 2020 at 5:10 PM 'Axel Wagner' via golang-nuts
wrote:
>
> IMO the discussion about this is purely based on the idea of type-lists which
> exists purely so as to support operators on type-parameters. And personally I
> feel a better way to solve this solution would be to just drop t
On Tue, Aug 4, 2020 at 11:48 AM Mahdi Hosseini wrote:
>
> I have a problem when trying to run the test for runtime when CGO is enabled.
> The test I want to run is CGO_ENABLED=1 go test -run=TestCgoSignalDeadlock
> inside src/runtime of the goroot. This test on my machine never compile the c
>
On Tue, Aug 4, 2020 at 1:21 PM Ravi Kant Soni wrote:
>
> runtime: epollwait on fd 4 failed with 38
> Fatal error: runtime : netpoll failed
>
> runtime stack:
> Runtime.throw(0xa59c24, 0x17)
>/apps/jenkins/build/tools/go1.12.6.linux-amd64/src/runtime/panic.go:617
> .
>
>
> This generates wh
runtime: epollwait on fd 4 failed with 38
Fatal error: runtime : netpoll failed
runtime stack:
Runtime.throw(0xa59c24, 0x17)
/apps/jenkins/build/tools/go1.12.6.linux-amd64/src/runtime/panic.go:617
.
This generates when I run generated binary from jenkins pipeline, in linux box
using
>
> Which at first seems like a good idea, but then unless "any" is built in
>> or this becomes a well-known idiom, it won't be as self-documenting. Other
>> people will have to look up the definition to see "oh, I see, this is just
>> short-hand for an empty constraint".
>
>
> I'm sure it woul
Hi,
I have a problem when trying to run the test for runtime when CGO is
enabled. The test I want to run is CGO_ENABLED=1 go test
-run=TestCgoSignalDeadlock inside src/runtime of the goroot. This test on
my machine never compile the c files and hence led to link problem while my
other CGO progr
On Tue, Aug 4, 2020 at 10:38 AM wrote:
>
> I used 1.12.6 Go library to develop GoLang Application with Beego framework.
> When I generate Binary in Linux box and run that binary in same linux box,
> its run fine.
>
> Issue is: when I generate Binary in Jenkins Pipeline, and run that binary in
>
Axel Wagner writes:
> I feel like https://go2goplay.golang.org/p/RLn9BXjU1OR is a better
> compromise than having two functions.
> Prolly. Except OP specifically asked about "not that" :)
Agreed on both counts.
--
You received this message because you are subscribed to the Google Group
Prolly. Except OP specifically asked about "not that" :)
On Tue, Aug 4, 2020 at 5:30 PM Andrei Tudor Călin wrote:
> I feel like https://go2goplay.golang.org/p/RLn9BXjU1OR is a better
> compromise than having two functions.
>
> On Tue, Aug 4, 2020 at 5:50 PM 'Axel Wagner' via golang-nuts <
> gola
I used 1.12.6 Go library to develop GoLang Application with Beego framework.
When I generate Binary in Linux box and run that binary in same linux box, its
run fine.
Issue is: when I generate Binary in Jenkins Pipeline, and run that binary in
Linux box, it gives error, epollwait on fd 4, and n
I feel like https://go2goplay.golang.org/p/RLn9BXjU1OR is a better
compromise than having two functions.
On Tue, Aug 4, 2020 at 5:50 PM 'Axel Wagner' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> No, that's not possible. A generic function can only work with *either*
> built in operato
No, that's not possible. A generic function can only work with *either*
built in operators *or* methods. So, you always need to have two functions:
https://go2goplay.golang.org/p/YuzSzDAOEo2
On Tue, Aug 4, 2020 at 4:32 PM Juliusz Chroboczek wrote:
> I'd be grateful if people could give me an ex
I'd be grateful if people could give me an example to help me understand
the generics draft. Suppose I've got these two functions:
func MemberInt(x int, a []int) bool {
for _, v := range a {
if v == x {
return true
}
}
Martin Møller Skarbiniks Pedersen,
Use a RoundUp function for n / d. For example,
// n / d rounded up
func RoundUp(n, d int64) int64 {
if d == 0 {
return 0
}
return (n + (d - 1)) / d
}
https://play.golang.org/p/kEMJ04ggkMc
Peter
On Tuesday, August 4, 2020 at 6:37:06 AM UTC-
On Tue, Aug 4, 2020 at 12:31 PM Martin Møller Skarbiniks Pedersen <
traxpla...@gmail.com> wrote:
bet := int64(math.Ceil(float64(cash)/float64(4)))
>
>
Programming languages must make a conscious choice here. Do we make type
casts explicit or implicit? Go opted for the explicit approach, probably
b
var cash, change, bet int64
:
bet = cash/4
// change is 0,1,2,3 meaning 0/4, 1/4, 2/4, 3/4 dineros or zlottys or
whatever
change = cash - 4*bet // or, change = cash%4
// choose one of these
if change>0{
bet++ // a: round up means 1/4 and 2/4 and 3/4 go to 1
}
// ...or...
if change>=2{
bet++ /
>
> On Sun, Aug 2, 2020 at 2:09 PM Martin Møller Skarbiniks Pedersen <
> traxp...@gmail.com > wrote:
>
>> I have written my first little piece of Go-code.
>> However it took some time and code for me to divide a int64 by 4 and
>> round down.
>>
>> [...]
>> var bet int64
>> bet = int64(math.Ceil(
>
> On Sun, Aug 2, 2020 at 2:09 PM Martin Møller Skarbiniks Pedersen <
> traxp...@gmail.com > wrote:
>
>> I have written my first little piece of Go-code.
>> However it took some time and code for me to divide a int64 by 4 and
>> round down.
>>
>> How can the last two lines be rewritten?
>>
>> R
>> That is an experiment. We don't seem to need the type keyword for
>> generic functions. But we do need it for generic types,
I'm used for years to look at code with generics in Java. The additional
type keyword as proposed for generics in Go in IMHO make reading the
declaration containing g
27 matches
Mail list logo