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)

🌱 DEV runs on 100% open source code known as Forem.

Β 
Contribute to the codebase or learn how to host your own.