Project Structure

지니🧸·2023년 8월 29일
0

Go

목록 보기
6/8

본 게시글은 Golang Tutorial for Beginners | Full Go Course을 학습하며 작성한 개인 노트입니다.

Project structure

Go programs are organized into packages
A package is a collection of Go files

  • create a helper.go file to include function used in main
  • moving forward, use go run main.go helper.go to run code

Multiple packages

Create helper folder to locate helper.go file

Hence, specify import of helper package to use functions

Export a variable/function

To make a variable available for all packages in the app, capitalize the first letter of the name

profile
우당탕탕

0개의 댓글

Powered by GraphCDN, the GraphQL CDN