DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

David Hwang
David Hwang

Posted on

5/31 TIL: CGO & GOOS in Go, Github Issue Template, Mathematical Induction

CGO & GOOS in Go

  • Cgo enables the creation of Go packages that call C code
  • Set CGO_ENABLED=0 or 1 along with Go build to disable or enable the cgo tool
  • You configure the Go Operating System using GOOS
  • Example of a go build within a Dockerfile:

RUN CGO_ENABLED=0 GOOS=linux go build -o fileName .

Enter fullscreen mode Exit fullscreen mode

Github Issue Template

Go Vendor

โ€”Discrete Mathโ€”

Quotient-Remainder Theorem:

For all n โˆˆ โ„ค, d โˆˆ โ„ค+, there exists q,r โˆˆ โ„ค so that n = dq + r with 0 โ‰ค r < d

Modular Arithmetic

  • n mod d; system of arithmetic where we are concerned with the remainder
  • Ex) Clock (n/12 = w + r), Day of the Week (n/7 = w + r)

Sequence

  • informal: an infinite ordered list of objects
  • formal: a function f: โ„ค+ โ†’ C

Mathematical Induction

  • Prove: P(n), โˆ€n โ‰ฅ a
  • Step 1: Prove that P(a) is trueโ€”basis step
  • Step 2: Assume P(k) is true, prove P(k+1) is true (for k โ‰ฅ a )โ€”induction step

Top comments (0)

๐ŸŒš Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.