2023/02/21 4

모듈 호출하기 Call your code from another module

모듈 만들기에 이어서 https://everyauto.tistory.com/24 [모듈 만들기 creating a module 모듈은 간단하게 말하자면 패키지를 모아 놓은 것이라고 보면 됩니다. 지난시간에 https://everyauto.tistory.com/22 [Golang 처음부터 시작해보기 최근들어 고랭 공부를 다시 시작해 보면서 기록을 좀 남 everyauto.tistory.com](https://everyauto.tistory.com/24) 이번엔 모듈을 호출해서 사용하는 것을 해보겠습니다.. greetings 와 hello 디렉토리를 생성후 코드를 작성했습니다. 이렇게 준비된 상태에서 hello 디렉토리로 이동합니다. 각 디렉토리에서 go.mod 커맨드를 이용해서 모듈을 만들어줍니다. go ..

프로그래밍/GO 2023.02.21

모듈 만들기 creating a module

모듈은 간단하게 말하자면 패키지를 모아 놓은 것이라고 보면 됩니다. 지난시간에 https://everyauto.tistory.com/22 Golang 처음부터 시작해보기 최근들어 고랭 공부를 다시 시작해 보면서 기록을 좀 남기고 복습도 하는 차원에서 블로그에 남기기로 결심했습니다. 블로그 아직까지 체계가 안잡혀서 중구난방이지만 최대한 잘 정리해볼게 everyauto.tistory.com rsc.io/quote 를 예제로 활용했는데 이 import 한것이 하나의 모듈이라고 볼 수 있습니다. 이 모듈안에는 해당 기능에 관련된 패키지들이 있고 패키지는 구현해 놓은 유용한 함수들이 들어있죠. 이번엔 이 모듈을 한번 만들어보고 가져와서 사용해보도록 하겠습니다. mkdir greetings cd greetings ..

프로그래밍/GO 2023.02.21

vscode 에서 Go 시작하기

https://go.dev/learn/ Get Started - The Go Programming Language Getting started In this tutorial, you'll get a brief introduction to Go programming. Along the way, you will install Go, write some simple "Hello, world" code, use the go command to run your code, use the Go package discovery tool, and call functions of an go.dev 에서 고랭 다운 먼저 받는다. 그리고 vs 코드에서 환경을 만들어줘야 하는데 간단하다! ctrl + shift + x 를 눌러..

Golang 처음부터 시작해보기

최근들어 고랭 공부를 다시 시작해 보면서 기록을 좀 남기고 복습도 하는 차원에서 블로그에 남기기로 결심했습니다. 블로그 아직까지 체계가 안잡혀서 중구난방이지만 최대한 잘 정리해볼게요 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 release history for more information..

프로그래밍/GO 2023.02.21