[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-692242-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-692242-en":130,"doc-similar-692242":154},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","go-programming-language-tutorial-chapter-1-introduction","Go Programming Language - Tutorial - Chapter 1 - Introduction","","Chapter 1 serves as a guided introduction to Go’s core building blocks, aiming to help readers quickly build useful programs. It presents a range of real-world oriented examples, warns against transferring habits from other languages, and positions the chapter’s code as a practical reference for writing good Go. The chapter begins with the traditional “hello, world” example, then explains how Go is compiled and how the go toolchain, subcommands, and run workflow operate.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/go-programming-language-tutorial-chapter-1-introduction/692242/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/go-programming-language-tutorial-chapter-1-introduction/692242.png","ImageObject",300,407,{"name":42,"@type":43},"Marglet","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-20","2026-11-09",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",9,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What is the purpose of Chapter 1 in learning Go?","Question",{"text":63,"@type":64},"Chapter 1 provides a tour of Go’s basic components and uses real-world oriented examples to help readers start building useful programs quickly.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"Why does the chapter warn about bias when learning a new language?",{"text":68,"@type":64},"It notes that learners often write code the way they would in a familiar language; the chapter encourages readers to be aware of this bias and avoid it while learning Go.",{"name":70,"@type":61,"acceptedAnswer":71},"How does Go compilation and running work according to the chapter?",{"text":72,"@type":64},"Go is compiled: the Go toolchain converts a source program and its dependencies into native machine instructions, and the go tool provides subcommands such as run to compile, link, and execute an output executable.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},692242,1794186704,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,105,110,115,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":102,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":103,"slug":104},6,50,"technology",{"id":106,"doc_module":4,"doc_module_name":25,"category_name":107,"show_sort_weight":108,"slug":109},7,"Healthcare",40,"healthcare",{"id":111,"doc_module":4,"doc_module_name":25,"category_name":112,"show_sort_weight":113,"slug":114},8,"Research & Report",30,"research-report",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":102,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":80,"read_time":144,"preview_page_count":26,"preview_urls":145},2336477982702,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","Contents  \nPreface xi  \nThe Origins of Go xii  \nThe Go Project xiii  \nOrganization ofthe Book xv  \nWhere to Find More Information xvi  \nAcknowledgments xvii  \n1. Tutorial 1  \n1.1. Hello, World 1  \n1.2. Command-Line Arguments 4  \n1.3. Finding Duplicate Lines 8  \n1.4. Animated GIFs 13  \n1.5. Fetchinga URL 15  \n1.6. Fetching URLs Concurrently 17  \n1.7. A Web Server 19  \n1.8. Loose Ends 23  \n2. Program Structure 27  \n2.1. Names 27  \n2.2. Declarations 28  \n2.3. Variables 30  \n2.4. Assignments 36  \n2.5. Type Declarations 39  \n2.6. Packages and Files 41  \n2.7. Scope 45  \nviii CONTENTS  \n3. Basic Data Types 51  \n3.1. Integers 51  \n3.2. Floating-Point Numbers 56  \n3.3. Complex Numbers 61  \n3.4. Booleans 63  \n3.5. Strings 64  \n3.6. Constants 75  \n4. Composite Types 81  \n4.1. Arrays 81  \n4.2. Slices 84  \n4.3. Maps 93  \n4.4. Structs 99  \n4.5. JSON 107  \n4.6. Text and HTML Templates 113  \n5. Functions 119  \n5.1. Function Declarations 119  \n5.2. Recursion 121  \n5.3. Multiple Return Values 124  \n5.4. Errors 127  \n5.5. Function Values 132  \n5.6. Anonymous Functions 135  \n5.7. Variadic Functions 142  \n5.8. Deferred Function Calls 143  \n5.9. Panic 148  \n5.10. Recover 151  \n6. Methods 155  \n6.1. Method Declarations 155  \n6.2. Methods with a Pointer Receiver 158  \n6.3. Composing Types by Struct Embedding 161  \n6.4. Method Values and Expressions 164  \n6.5. Example: Bit Vector Type 165  \n6.6. Encapsulation 168  \n7. Interfaces 171  \n7.1. Interfaces as Contracts 171  \n7.2. Interface Types 174  \n7.3. Interface Satisfaction 175  \n7.4. Parsing Flags with flag.Value 179  \n7.5. Interface Values 181  \nCONTENTS ix  \n7.6. Sorting with sort.Interface 186  \n7.7. The [http.Handler](http.Handler) Interface 191  \n7.8. The error Interface 196  \n7.9. Example: Expression Evaluator 197  \n7.10. Type Assertions 205  \n7.11. Discriminating Errors with Type Assertions 206  \n7.12. Querying Behaviors with Interface Type Assertions 208  \n7.13. Type Switches 210  \n7.14. Example: Token-Based XML Decoding 213  \n7.15. A Few Words ofAdvice 216  \n8. Goroutines and Channels 217  \n8.1. Goroutines 217  \n8.2. Example: Concurrent Clock Server 219  \n8.3. Example: Concurrent Echo Server 222  \n8.4. Channels 225  \n8.5. Looping in Parallel 234  \n8.6. Example: Concurrent Web Crawler 239  \n8.7. Multiplexing with select 244  \n8.8. Example: Concurrent Directory Traversal 247  \n8.9. Cancellation 251  \n8.10. Example: Chat Server 253  \n9. Concurrency with Shared Variables 257  \n9.1. Race Conditions 257  \n9.2. Mutual Exclusion: sync.Mutex 262  \n9.3. Read/Write Mutexes: sync.RWMutex 266  \n9.4. Memory Synchronization 267  \n9.5. Lazy Initialization: sync.Once 268  \n9.6. The Race Detector 271  \n9.7. Example: Concurrent Non-Blocking Cache 272  \n9.8. Goroutinesand Threads 280  \n10. Packages and the Go Tool 283  \n10.1. Introduction 283  \n10.2. Import Paths 284  \n10.3. The Package Declaration 285  \n10.4. Import Declarations 285  \n10.5. Blank Imports 286  \n10.6. Packages and Naming 289  \n10.7. The Go Tool 290  \nx CONTENTS  \n11. Testing 301  \n11.1. The go test Tool 302  \n11.2. Test Functions 302  \n11.3. Coverage 318  \n11.4. Benchmark Functions 321  \n11.5. Proﬁling 323  \n11.6. Example Functions 326  \n12. Re􀀏ection 329  \n12.1. Why Reﬂection? 329  \n12.2. reflect.Type and reflect.Value 330  \n12.3. Display, aRecursive Value Printer 333  \n12.4. Example: EncodingS-Expressions 338  \n12.5. Setting Variables with reflect.Value 341  \n12.6. Example: Decoding S-Expressions 344  \n12.7. Accessing Struct Field Tags 348  \n12.8. Displaying the Methodsofa Type 351  \n12.9. A Word of Caution 352  \n13. Low-Level Programming 353  \n13.1. unsafe.Sizeof, Alignof, and Offsetof 354  \n13.2. unsafe.Pointer 356  \n13.3. Example: Deep Equivalence 358  \n13.4. Calling C Code with cgo 361  \n13.5. Another Word of Caution 366  \nIndex 367  \n1  \nTutorial  \nThis chapter is a tour of the basic components of Go. We hope to provide enough information and examples to get you off the ground and doing useful things as quickly as possible. The examples he","cbCaivpCvu8L2632","https://ap.wps.com/l/cbCaivpCvu8L2632","pdf",979932,18,"English","# Tutorial\n## Hello, World\n## Command-Line Arguments\n## Finding Duplicate Lines\n## Animated GIFs\n## Fetching a URL\n## Fetching URLs Concurrently\n## A Web Server\n## Loose Ends","[{\"question\":\"What is the purpose of Chapter 1 in learning Go?\",\"answer\":\"Chapter 1 provides a tour of Go’s basic components and uses real-world oriented examples to help readers start building useful programs quickly.\"},{\"question\":\"Why does the chapter warn about bias when learning a new language?\",\"answer\":\"It notes that learners often write code the way they would in a familiar language; the chapter encourages readers to be aware of this bias and avoid it while learning Go.\"},{\"question\":\"How does Go compilation and running work according to the chapter?\",\"answer\":\"Go is compiled: the Go toolchain converts a source program and its dependencies into native machine instructions, and the go tool provides subcommands such as run to compile, link, and execute an output executable.\"}]","Go Programming Language - Tutorial - Chapter 1 - Introduction | PDF",45,[146,150],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/c0b765602d1d7c1e9d6e45776c9156eb.webp",983,1415,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/ce98711c801bb0dbd491ca1f61b0760e.webp",982,1414,{"list":155,"token":11},[156,163,170,177,183,189,195,202,209,216],{"doc_id":157,"doc_title":158,"file_type":137,"home_preview_img_url":159,"slug":160,"view_count":161,"category_name":29,"create_tm":162},692237,"Guide to Golang","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002689626/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=TQA49E%2Bbia%2BnWp6%2FB4h1%2FcWCZHI%3D","guide-to-golang",13,1794186693,{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":168,"category_name":29,"create_tm":169},424686,"Programming - Chapter 3 - Natural Languages and Programming Languages","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229922357828/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=bOn%2BZh8%2BdFkgTu21eX2wIoS9xV8%3D","programming-chapter-3-natural-languages-and-programming-languages",15,1790635065,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":175,"category_name":29,"create_tm":176},510016,"D&D 5E Statistics - Murder in Baldur’s Gate - V1.1","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229934857330/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=zDrb%2Fmv8xfpINNo%2B%2FKkprspYxWQ%3D","dd-5e-statistics-murder-in-baldurs-gate-v11",17,1791238484,{"doc_id":178,"doc_title":179,"file_type":137,"home_preview_img_url":180,"slug":181,"view_count":26,"category_name":29,"create_tm":182},760094,"IntelliJ IDEA Installation Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044495509/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=tcVUkuUo8YdfZ4B4syehxyedCDU%3D","intellij-idea-installation-guide",1795898502,{"doc_id":184,"doc_title":185,"file_type":137,"home_preview_img_url":186,"slug":187,"view_count":113,"category_name":29,"create_tm":188},391832,"React Native for Mobile Development - Second Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229917408000/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=wPo5P1i3C%2F0YlVObFX6imllyoCY%3D","react-native-for-mobile-development-second-edition",1790359233,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":55,"category_name":29,"create_tm":194},516975,"WARHAMMER EVENT COMPANION - VERSION 1.1 - What's New","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229937734883/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=tZe3B7K2e9m84DoiynmFaOucpX0%3D","warhammer-event-companion-version-11-whats-new",1791334216,{"doc_id":196,"doc_title":197,"file_type":137,"home_preview_img_url":198,"slug":199,"view_count":200,"category_name":29,"create_tm":201},115355,"Claude AI Bible - The Complete Guide to Mastering Claude, Claude Code, Claude Cowork, MCP, AI Agents, Automation & Advanced Prompting","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229831893665/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=RdTaCB7se88bUxAYRtV4N9VHK4Y%3D","claude-ai-bible-the-complete-guide-to-mastering-claude-claude-code-claude-cowork-mcp-ai-agents-automation-advanced-prompting",945,1785472614,{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":207,"category_name":29,"create_tm":208},185,"XNX Universal Transmitter Installation Manual (Complete Guide) [Honeywell Official]","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693710157/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=nyd9YmsfN5vmNrhV8C7fGvhUo44%3D","xnx-universal-transmitter-installation-manual",865,1776135954,{"doc_id":210,"doc_title":211,"file_type":137,"home_preview_img_url":212,"slug":213,"view_count":214,"category_name":29,"create_tm":215},299143,"THE CANDLESTICK TRADING BIBLE - Trading Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229905832418/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=ycqfBmLAjuGpVsh2SLgtJr%2FMHaI%3D","the-candlestick-trading-bible-trading-guide",819,1789767270,{"doc_id":217,"doc_title":218,"file_type":137,"home_preview_img_url":219,"slug":220,"view_count":221,"category_name":29,"create_tm":222},176,"Free Fire Proxy Server","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693709822/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796213339&Signature=ABl7tZINb97JhdXP7kd7YCslS3s%3D","free-fire-proxy-server",570,1776135932]