본문 바로가기

go

(5)
[go mod 번역] Go에서 Go Modules 사용해보기 이번 포스팅은 Go 블로그에 업데이트되어있는 Go modules을 사용하는 방법에 관한 포스팅입니다. 번역 포스팅의 원본 링크 주소 blog.golang.org/using-go-modules Using Go Modules - The Go Blog Tyler Bui-Palsulich and Eno Compton 19 March 2019 Introduction This post is part 1 in a series. Go 1.11 and 1.12 include preliminary support for modules, Go’s new dependency management system that makes dependency version information explicit and easier blog.g..
[Go언어] GoLang을 활용하여 웹페이지 크롤링 이번 포스팅은 Go언어를 사용하여 웹 페이지를 크롤링하는 튜토리얼 입니다. 아래 포스팅은 노마드코더의 golang강의를 기반으로 작성되었습니다. 크롤링 할 페이지 선택 취업검색 | Indeed (인디드) kr.indeed.com >> 취업에 대한 정보가 나와있는 웹사이트 >> 검색어 쿼리를 던졌을 때 출력되는 결과를 크롤링 크롤링 코드 작성 (Go Lang) 사용 할 라이브러리 설치 - Go언어에서 크롤링을 하기 위해 필요한 라이브러리 설치 $ go get github.com/PuerkitoBio/goquery - 아래는 Goquery 깃허브 링크 PuerkitoBio/goquery A little like that j-thing, only in Go. Contribute to PuerkitoBio/go..
[Go] Go언어 튜토리얼3_조건문, 반복문 사용하기 이번 포스팅은 go언어를 사용하여 조건문, 반복문 등을 사용하는 튜토리얼 입니다 1. for, range, ...args - Go에서 loop는 오로지 for을 사용하는 것만으로 가능함 - 여기서 사용되는 range는 array에 loop를 적용할 수 있도록 해줌 - range는 실행시 index와 value를 같이 return 한다. package main import "fmt" func superAdd(numbers ...int) int { for index, number := range numbers { fmt.Println(index, number) } return 1 } func main() { superAdd(10,20,30,40,50) } >> 위 함수를 실행하면 아래와 같이 index와 v..
[Go] Go언어 튜토리얼1_상수와 변수 아래 포스팅은 노마트코더의 Go언어 강의를 바탕으로 작성 된 튜토리얼 입니다 Export / Private Function 사용 - 현재 폴더 디렉터리 구조는 /learngo 아래에 main.go 파일이 생성된 상태 - export func 테스트를 위해 /learngo/something 폴더 생성 - 그 아래 /learngo/something/something.go 파일 작성 - something.go 작성 package something import "fmt" //소문자로 시작하는 function은 export 불가능 //private function이다. func sayBye() { fmt.Println("Bye") } //SayHello func //function을 export하고 싶을 떄는 f..
[Go] Go 언어 시작하기 (VS Code 사용 및 설치) 이번 포스팅은 GO언어와 vscode 설치에 관한 포스팅입니다. Mac에 VScode 설치 - 아래 홈페이지에 접속해서 Mac 버전의 vscode를 설치 https://code.visualstudio.com Visual Studio Code - Code Editing. Redefined Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. code.visualstudio.c..