Posts

Go 배열/슬라이스 초기화

2023/09/23
programming
go

TIL; 미리 정의된 값을 사용하여 배열을 초기화 할 때 배열을 길이를 지정하지 않고 [...]type을 사용할 수 있다. 컴파일러가 지정된 값에 따라 알아서 해준다. 배열 ...

macOS 자동 실행 프로그램들

2023/09/23
macos

자동으로 실행되는 백그라운드 프로세스들 중 애플에서 배포된 것이 아닌 것들을 확인하는 방법. launchctl list | grep -v "com.apple" 자동 실행되는 프로세스를 제거하는 방법. launchctl remove com.google.keystone.system.agent

Time Zone 데이터베이스

2023/09/23
programming
go

간혹 Go가 실행되는 환경에 time zone 데이터가 설치되지 않아서 난감한 경우가 있다. 예를 들어 AWS 특정 타입의 EC2 인스턴스나 Windows 환경인 경우 time.LoadLocation() 함수를 호출하면 에러가 발생한 ...

Go프로그램으로 CPU 종류와 기능 확인하기

2023/09/22
programming
go

The cpuid.CPU provides access to CPU features. Use cpuid.CPU.Supports() to check for CPU features. A faster cpuid.CPU.Has() is provided which will usually be inlined by the gc compiler. To test a larger number of features, they can be combined using f := CombineFeatures(CMOV, CMPXCHG8, X87, FXSR, MMX, SYSCALL, SSE, SSE2), etc. This can be using with cpuid.CPU.HasAll(f) to quickly test if all features are supported. Note that for some cpu/os ...