[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"academy-blogs-en-1-1-all-introduction-to-variables-and-data-types-in-go-all--*":3,"academy-blog-translations-yfn0t5rbxh8j63k":80},{"data":4,"page":67,"perPage":67,"totalItems":67,"totalPages":67},[5],{"alt":6,"collectionId":7,"collectionName":8,"content":9,"cover_image":10,"cover_image_path":11,"created":12,"created_by":13,"expand":14,"id":75,"keywords":76,"locale":49,"published_at":77,"scheduled_at":13,"school_blog":71,"short_description":78,"status":69,"title":6,"updated":79,"updated_by":13,"slug":72,"views":74},"EP.2 Introduction to Variables and Data Types in Go - Fundamentals You Need to Know!","sclblg987654321","school_blog_translations","\u003Cp>\u003Cspan style=\"font-size:20px;\">\u003Cstrong>Introduction to Variables and Data Types in Go - Fundamentals You Need to Know!\u003C\u002Fstrong>\u003C\u002Fspan>\u003C\u002Fp>\u003Cp>Variables - What are Variables? Variables are storage locations in a program for data, such as numbers, text, or various values that we want to use in our code. In Go, we declare variables using the keyword var or by using a shorthand method, which is :=\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">var x int = 10 \u002F\u002F ประกาศตัวแปรแบบกำหนดชนิดข้อมูล\r\nname := \"Go\" \u002F\u002F แบบสั้น ไม่ต้องระบุชนิดข้อมูล\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cstrong>Data Types - Data Types in Go\u003C\u002Fstrong> In Go, we need to specify the data type for variables, such as:\u003C\u002Fp>\u003Cul>\u003Cli>int: stores integers\u003C\u002Fli>\u003Cli>float64: stores floating-point numbers\u003C\u002Fli>\u003Cli>string: stores text\u003C\u002Fli>\u003Cli>bool: stores boolean values (True\u002FFalse)\u003C\u002Fli>\u003C\u002Ful>\u003Cp>Go is a strongly-typed language (requiring explicit data type declaration) for safety and to prevent programming errors.\u003C\u002Fp>\u003Cp>Example\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">var age int = 25\r\nvar height float64 = 5.9\r\nisStudent := true\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>Displaying Variables Try writing a program that declares multiple variable types and outputs them.\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">package main\r\n\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n    var age int = 25\r\n    name := \"Alice\"\r\n    fmt.Println(\"Name:\", name)\r\n    fmt.Println(\"Age:\", age)\r\n}\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>Using var If you want to specify the data type, you can use the keyword var, but if you want to write shorter and more concise code, just use := and Go will automatically infer the data type for you!\u003C\u002Fp>","3jdzbbxky6v_il1kp7u7ea.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002Fooxll573vzardwf\u002F3jdzbbxky6v_il1kp7u7ea.webp","2026-03-04 08:34:31.558Z","",{"keywords":15,"locale":43,"school_blog":53},[16,23,28,33,38],{"collectionId":17,"collectionName":18,"created":19,"created_by":13,"id":20,"name":21,"updated":22,"updated_by":13},"sclkey987654321","school_keywords","2026-03-04 08:34:27.106Z","cc6l2tzira856vc","Coding Fundamentals","2026-04-10 16:08:14.797Z",{"collectionId":17,"collectionName":18,"created":24,"created_by":13,"id":25,"name":26,"updated":27,"updated_by":13},"2026-03-04 08:32:51.346Z","tmzmy6jyz1n35rr","Go Programming","2026-04-10 16:08:01.434Z",{"collectionId":17,"collectionName":18,"created":29,"created_by":13,"id":30,"name":31,"updated":32,"updated_by":13},"2026-03-04 08:33:59.315Z","btmgtfwmgpke1aa","Go language","2026-04-10 16:08:04.625Z",{"collectionId":17,"collectionName":18,"created":34,"created_by":13,"id":35,"name":36,"updated":37,"updated_by":13},"2026-03-04 08:34:29.179Z","l654i4lm62wxtz2","Data Types in Go","2026-04-10 16:08:15.580Z",{"collectionId":17,"collectionName":18,"created":39,"created_by":13,"id":40,"name":41,"updated":42,"updated_by":13},"2026-03-04 08:34:30.348Z","czr4sxt4ath4t4l","Variables in Go","2026-04-10 16:08:16.048Z",{"code":44,"collectionId":45,"collectionName":46,"created":47,"flag":48,"id":49,"is_default":50,"label":51,"updated":52},"en","pbc_1989393366","locales","2026-01-22 11:00:02.726Z","twemoji:flag-united-states","qv9c1llfov2d88z",false,"English","2026-04-10 15:42:46.825Z",{"category":54,"collectionId":55,"collectionName":56,"created":13,"expand":57,"id":71,"slug":72,"updated":73,"views":74},"wqxt7ag2gn7xcmk","pbc_2105096300","school_blogs",{"category":58},{"blogIds":59,"collectionId":60,"collectionName":61,"created":62,"created_by":13,"id":54,"image":63,"image_alt":13,"image_path":64,"label":65,"name":66,"priority":67,"publish_at":68,"scheduled_at":13,"status":69,"updated":70,"updated_by":13},[],"sclcatblg987654321","school_category_blogs","2026-03-04 08:33:53.210Z","59ty92ns80w_15oc1implw.png","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclcatblg987654321\u002Fwqxt7ag2gn7xcmk\u002F59ty92ns80w_15oc1implw.png",{"en":66,"th":66},"Golang The Series",1,"2026-03-16 04:39:38.440Z","published","2026-04-25 02:32:15.470Z","yfn0t5rbxh8j63k","introduction-to-variables-and-data-types-in-go","2026-05-10 08:54:20.594Z",221,"ooxll573vzardwf",[20,25,30,35,40],"2025-01-20 08:26:30.694Z","Learn about variables and data types in the Go language that will help you confidently start coding.","2026-04-25 02:47:33.067Z",{"th":72,"en":72}]