Skip to Content
Go 소개
book

Go 소개

by Caleb Doxsey
May 2025
Beginner to intermediate
124 pages
1h 15m
Korean
O'Reilly Media, Inc.
Content preview from Go 소개

부록 A. 답변

부록 A. 1장

  1. 공백은 공백, 탭, 줄 바꿈 문자로 구성된 문자 사이의 공백입니다.

  2. 주석은 컴파일러에서 무시되는 코드 섹션으로, 코드를 읽는 모든 사람이 참고할 수 있는 메모로 사용할 수 있습니다. 주석의 두 가지 유형은 // (줄 끝으로 이동)와 /* */ 입니다.

  3. fmt 패키지의 파일은 package fmt 으로 시작됩니다.

  4. os 패키지에서 Exit 함수를 사용하려면 os 패키지( import "os" )를 가져온 다음 .: os.Exit() 으로 호출해야 합니다.

  5. 내 이름으로 인쇄하도록 프로그램을 수정합니다:

    package main
    
    import "fmt"
    
    func main() {
        fmt.Println("Hello, my name is Caleb")
    }
    

부록 A. 2장

  1. 정수는 기본 2진수 시스템을 사용하여 컴퓨터에 저장됩니다.

  2. 2진수에서 가장 큰 8자리 숫자는 255입니다.

  3. 32,132 × 42,452를 계산하여 터미널에 출력하는 프로그램입니다:

    package main
    
    import "fmt"
    
    func main() {
        fmt.Println(32132 * 42452)
    }
    
  4. 문자열은 문자의 시퀀스입니다. len 함수(len("a string"))를 사용하여 문자열의 길이를 찾을 수 있습니다.

  5. 표현식의 값은 true 입니다.

부록 A. 3장

  1. 새 변수를 만드는 두 가지 방법은 var x = 5 또는 x := 5 입니다.

  2. 방정식을 실행한 후 x 의 값은 6 입니다.

  3. 범위는 변수를 사용할 수 있는 위치의 범위입니다. Go의 범위는 블록을 사용하여 어휘적으로 결정되므로 가장 가까운 중괄호를 찾습니다.

  4. 변수와 달리 상수의 값은 컴파일 시점에 결정되며 프로그램 수명 동안 변경할 수 없습니다.

  5. 화씨를 섭씨로 변환하는 프로그램입니다:

    package main
    
    import "fmt"
    
    func main() {
        fmt.Print("Enter a number: ")
        var input float64
        fmt.Scanf("%f", &input)
    
        output := (input - 32) * 5/9
    
        fmt.Println(output)
    }
  6. 피트를 미터로 변환하는 프로그램입니다:

    package main
    
    import "fmt"
    
    func main() {
        fmt.Print("Enter a number: ")
        var input float64
        fmt.Scanf("%f", &input)
    
        output := input * 0.3048
    
        fmt.Println(output)
    }

부록 A. 4장

  1. 프로그램이 인쇄됩니다: 작음.

  2. 3으로 나눌 수 있는 1에서 100 사이의 모든 숫자를 출력하는 프로그램입니다:

    package main
    
    import "fmt"
    
    func main() {
        for i := 1; i <= 100; i++ {
            if i % 3 == 0 {
                fmt.Println(i)
            }
        }
    }
    
  3. 숫자 1~100을 출력하되 3의 배수는 '피즈', 5의 배수는 '버즈', 3과 5의 배수는 모두 '피즈버즈'로 대체하는 프로그램입니다:

    package main
    
    import 
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

효율적인 Go

효율적인 Go

Bartlomiej Plotka
핸즈온 머신러닝(3판)

핸즈온 머신러닝(3판)

오렐리앙 제롱(Aurélien Géron)
러닝 랭체인

러닝 랭체인

메이오 오신, 누노 캄포스
Go의 동시성

Go의 동시성

Katherine Cox-Buday

Publisher Resources

ISBN: 9798341659827