일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- ㅒ
- 티스토리 쿠키 삭제
- d
- 구멍가게코딩단
- 스프링 시큐리티
- iterator
- 코드로배우는스프링부트웹프로젝트
- baeldung
- 자료구조와함께배우는알고리즘입문
- 네트워크 설정
- resttemplate
- 서버설정
- 이터레이터
- 처음 만나는 AI 수학 with Python
- 자료구조와 함께 배우는 알고리즘 입문
- 목록처리
- /etc/network/interfaces
- network configuration
- 스프링부트핵심가이드
- 친절한SQL튜닝
- 알파회계
- 코드로배우는스프링웹프로젝트
- 데비안
- 페이징
- 처음 만나는 AI수학 with Python
- GIT
- 자바편
- 리눅스
- 선형대수
- Kernighan의 C언어 프로그래밍
- Today
- Total
목록전체 글 (406)
bright jazz music
package myDict// type에도 메소드를 추가할 수 있다. struc에만 추가할 수 있는 것이 아니다.// type 옆의 Dictionary는 map[string]string의 alias 같은 것임.//Dictionary Typetype Dictionary map[string]string메인package mainimport ( "fmt" "github.com/hojuncha997/learngo/accounts/myDict")func main() { dictionary := myDict.Dictionary{} dictionary["hello"] = "hello" dictionary["hello2"] = "hello2" fmt.Println(dictionary)}===map[hello:hello ..
package accountsimport ( "errors" "fmt")//Account structtype Account struct { owner string balance int}var errNoMoney = errors.New("Can't witdhraw") //에러의 변수명은 err로 시작해야 함//NewAccount creates Accountfunc NewAccount(owner string) *Account { account := Account{owner: owner, balance: 0} return &account //사본 말고 메모리 주소 반환}//Deposit x amount on your accountfunc (a *Account) Deposit(amount int) { //메..
어카운트package accountsimport "errors"//Account structtype Account struct { owner string balance int}var errNoMoney = errors.New("Can't witdhraw") //에러의 변수명은 err로 시작해야 함//NewAccount creates Accountfunc NewAccount(owner string) *Account { account := Account{owner: owner, balance: 0} return &account //사본 말고 메모리 주소 반환}//Deposit x amount on your accountfunc (a *Account) Deposit(amount int) { //메소드임. ..
캡슐화package accounts//Account structtype Account struct { owner string balance int}//NewAccount creates Accountfunc NewAccount(owner string) *Account { account := Account{owner: owner, balance: 0} return &account //사본 말고 메모리 주소 반환} 메인 package mainimport ( "fmt" "github.com/hojuncha997/learngo/accounts")func main() { account := accounts.NewAccount("hojun") fmt.Println(account)}===&{hojun 0} //사본..
package mainimport ( "fmt")type person struct { name string age int favFood []string}func main() { favFood := []string{"kimchi", "pizza"} nico := person{"nico", 18, favFood} fmt.Println(nico) //nico.name 이런 것도 됨. //어쨌든 이런 방식의 입력은 권장되지 않음}==={nico 18 [kimchi pizza]} //두 번째 방법package mainimport ( "fmt")type person struct { name string age int favFood []string}func main() { fa..
package mainimport ( "fmt")func main() { nico := map[string]string{"name": "nico", "age": "12"} //[key] [value] fmt.Println(nico)}//자바스크립트나 파이선의 오브젝트와 유사함. 같지는 않음 package mainimport ( "fmt")func main() { nico := map[string]string{"name": "nico", "age": "12"} //[key] [value] for key, _ := range nico { fmt.Println(key) }}===nameage package mainimport ( "fmt")func main() { nico := map[string]s..