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)