Skip to content

Instantly share code, notes, and snippets.

View mahmud2011's full-sized avatar
🎯
Focusing

Mahmudul Haque (Yamin) 🇵🇸 mahmud2011

🎯
Focusing
  • TU Berlin
  • Berlin
View GitHub Profile
@mahmud2011
mahmud2011 / k8s.md
Last active April 4, 2024 18:05
K8s cheat sheet
kubectl config view
kubectl config get-contexts
kubectl config use-context minikube
package domain
// https://jira.atlassian.com/rest/api/2/issuetype
type IssueType struct {
Self string `json:"self"`
ID string `json:"id"`
Description string `json:"description"`
IconURL string `json:"iconUrl"`
Name string `json:"name"`

Loop:

for i, v := range slice here v is a copy of the element at index i. So, v = "new_val" will not be reflected in slice.

Ref: https://go.dev/tour/moretypes/16

Create Docker Registry

kubectl create secret docker-registry regsecret \ 
--docker-server=https://test.server.com \
--docker-username=admin-user \
--docker-password=admin-pass \
--docker-email=admin@server.com -n ns

Variable and Type

  • Short variable declaration is function scoped.

  • Width of int and uint are system dependent. If the architeture is 64 bit then the width of int and uint are 64 bit.

  • float64 is default floating point type and recommended. Don't use float32 if there is no valid reason.

  • Go's const is compile time constant. An untyped constant takes the type needed by its context. It can be use in place of int and float64.