본문 바로가기

Go

(6)
(Go error) - missing go.sum entry for module providing package <package_name> 🍳머리말 import문 내 go pkg를 추가후 go.mod를 갱신한 상황에서 떴던 error였습니다. 📕설명 📔 설명 go mod tidy는 go.mod에 맞춰 go.sum을 갱신해주는 명령어 입니다. pkg 추가시 go mod tidy를 아끼지 맙시다. 📕참조 https://stackoverflow.com/questions/67203641/missing-go-sum-entry-for-module-providing-package-package-name missing go.sum entry for module providing package Using the buffalo framework, after bootstraping it via buffalo new I am trying to run buffal..
(Go) - Window에 go 설치 및 환경설정 🍳머리말 go 설치 및 환경변수 설정 설명글입니다. 📕환경 📔 window 10 window + r을 눌러 winver를 치고 확인을 누르면 version을 확인할 수 있습니다 📕 go 설치 📔 설명 go는 여기서 설치할 수 있습니다. https://go.dev/dl/ Downloads - The Go Programming Language Downloads After downloading a binary release suitable for your system, please follow the installation instructions. If you are building from source, follow the source installation instructions. See the relea..
(client-go Error) - "but does not contain package k8s.io/api/auditregistration/v1alpha1" 🍳머리말 자주 go에서 package 종속성 떄문에 골머리를 썩습니다. 몰래 새로운 version release를 하며 sub module을 없애는 경우도 흔하고 덕분에 어제 돌아가던 code가 한 순간에 동작하지 않는 경우가 있습니다. 이 경우도 그렇습니다. 📕client-go 📔 설명 그냥 go get client-go 를 하게 되면 가장 최신 version을 받습니다. 제 경우는 v0.24.3을 받게 되었는데 때문에 다음 error를 go mod tidy시 받았습니다. k8s.io/api/auditregistration/v1alpha1: module k8s.io/api@latest found (v0.24.3), but does not contain package k8s.io/api/auditregi..
(Go) - go get과 go mod download 차이 🍳머리말 go get명령어와 go mod download의 차이는 무엇일까요? 📕 mod file 📔 module이란 https://go.dev/doc/modules/gomod-ref go.mod file reference - The Go Programming Language go.mod file reference Each Go module is defined by a go.mod file that describes the module’s properties, including its dependencies on other modules and on versions of Go. These properties include: The current module’s module path. This should..
(Go) - Marshal, Unmarshal 함수 🍳머리말 Marshal과 Unmarshal함수에 대해 설명한 글입니다. 📕Marshal 📔 정의 https://ko.wikipedia.org/wiki/%EB%A7%88%EC%83%AC%EB%A7%81_(%EC%BB%B4%ED%93%A8%ED%84%B0_%EA%B3%BC%ED%95%99) 마샬링 (컴퓨터 과학) - 위키백과, 우리 모두의 백과사전 컴퓨터 과학에서 마셜링(marshalling, l을 하나만 사용하여 marshaling이라고도 표기)이란 한 객체의 메모리에서 표현방식을 저장 또는 전송에 적합한 다른 데이터 형식으로 변환하는 과정이다. 또한 ko.wikipedia.org data를 다른 program이 인식할 수 있는 형태로 적합하게 변형하는 것입니다. 이를 수행하면 예를 들어, 서로 떨어진 객..
(Go) - test하기 🍳머리말 go의 testing module을 사용해 test를 하는 예제 설명글입니다 📕동작방식 📔 testing go testing module은 "_test.go" 형식의 file명을 확인해 동작합니다. 📕설명 📔 ./test/sum_test.go test folder 생성후 하위에 다음 file들을 만들어 줍니다. package main import ( "testing" ) // Test methods start with `Test` func TestSum(t *testing.T) { got := Sum(1, 2) want := 3 if got != want { t.Errorf("Sum(1, 2) == %d, want %d", got, want) } } 📔 ./test/sum.go package m..