Giter VIP home page Giter VIP logo

mastering-go-3rd's People

Contributors

cael0 avatar crazyoptimist avatar mactsouk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mastering-go-3rd's Issues

type constrait syntax error

//fixing syntax error on numeric.go (ch13) line 8:
package main

import (
"fmt"
)

type Numeric interface {
int | int8 | int16 | int32 | int64 | float64
}

func Add[T Numeric](a, b T) T {
return a + b
}

func main() {
fmt.Println("4 + 3 =", Add(4,3))
fmt.Println("4.1 + 3.2 =", Add(4.1,3.2))
}

Why is `os.Exit` called in `signals.go`

From:

case syscall.SIGINFO:
handleSignal(sig)
// do not use return here because the goroutine will exit
// but the time.Sleep() will continue to work!
os.Exit(0)

Why is os.Exit() called for SIGINFO. I tried this locally with SIGUSR1 and executing:

$ kill -USR1 <pid>

caused the complete process to exit not just the go routine. The <pid> didn't exist anymore and the process had terminated.
When I tried the same example by commenting out os.Exit(), it worked perfectly fine and the for loop was still continuing and the go routine hadn't exited.

I am on Ch-06 right now so my knowledge about goroutines and channels is limited.

Where is code for chap 12?

Why isn't the code for chap 12 available?

When implementing the GetRandom method you are suddenly using a function method(min, max).
Where is this function coming from? What are min and max?

The value of the Slice has been Changed!!

with the line 47 of the code sliceArrays.go,it says:

// This change does not go to S12
a[1] = "-N2-"

but Actually, the changes of a[1] does go to S12 !

By the way , the Book is right: "However, array a and slice S12 are still connected because the capacity of S12 has not
changed."

"uninitialized" variables

When the first argument is non-parseable, the min/max variables are not initialized to the first parseable argument (but to 0 by default). This would lead to bug when all the parseable arguments share the same sign.

if i == 1 {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.