일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- golang
- TypeScript
- 도커컨테이너
- IAC
- apiTest
- smui
- svelte
- ...$$restProps
- react
- 도커
- GraphQL
- bitwiseNot
- mock
- nestjs
- :=
- githook
- Terraform
- cron
- onDestory
- docker
- docker-network
- 번역
- go
- PostgreSQL
- Svelte LifeCycle
- testing
- reactjs
- 인라인핸들러
- GIT
- JavaScript
Archives
- Today
- Total
목록pointer (1)
Den`s blog
Method & Pointer
Go 에서 Struct 를 주로 이용한다고 했는데, 여기에 메소드도 추가가 가능하다. 말로 설명하면 길어지니 코드부터 보자. // Account account Structure type Account struct { owner string balance int } var errNoMoney = errors.New("can't withdraw") // NewAccount Creates Account func NewAccount(owner string) *Account { account := Account{owner: owner, balance: 0} return &account } // Deposit x amount on your account func (theAccount *Account) Deposit..
GoLang
2021. 1. 31. 01:48