Hello world program of Go

Now we are going to move on to the Write code part.

We have completed our environment setup, and now it is time to sart working on our first very small program .

The first program that we are going to woking on is actually a "Hello world" type application.

In this section,we will figure out how to create a "Hello world" program of Go. In the next section,we will talk about each and every line of code in this program and do a really deep dive on Go how to work behind the scenes

If you prefer, you can skip this chapter.

We are going to put the whole program up on the screen

Now Let us satrt off by creating a new project folder.

You can find the File option at the top menu bar. and then click on the Open Folder option in the pop-up menu.

After you do that, a window should pop up, and then you should select a directory that you want to house your first program . And click on the "Select folder" button to open up the new folder.

Now you can locate the HelloWorld project in the pop-up left hand navigation panel.

The Navigation panel is what allows us to view all different files and folders that are inside of our working project.

Let us click on that area that says HelloWorld, You should see a set of buttons on the top right of the Navigation panel like this.

Then let us create a new file by clicking on the New File button,And call the file "main.go".

When we do that , you should have a code editor window open like this.

So Inside here is where we are going to put a hello world type program.

Now I will show how to write out the tiny program in this video. Let us go.

lesson 6

As that video says,we have completed writing out the whole hello world type program. We will discuss each and every line of code of the simple program in great detail. So see you next chapter

The original video and subtitles

Video: Hello World

subtitles :

Now that we are all done with our environment set up.

We are going to start working on our first very tiny, very little program.

Now the first program we are going to work on is essentially going to be a "Hello world" type app.

We are just going to connect console log out or log out some little piece of data.

And so I know this is a very boring program to start off with.

But trust me we are going to do a really deep dive on exactly how Go is working behind the scenes.

We are going to learn a lot about how we compile build projects all this kind of good stuff by just studing this tiny little program.

So even though it is going to be a very small program, we are going to learn a lot out of it.

So We are going to flip on over toward code editor.

In this section we are just going to wirte out a very simple program and then we will take a break,come back in the next video and we will start to do the deep dive on exactlly how it is working.

So I am going to start off by creating a new project folder to house the little program.

I am going to go up to file. I will click on Open and then I am going to make a new folder to house this new project.

It is going to click on the new folder down here and I am going to call the new folder

Now once I craete that new folder I should see it become selected and click on Open down here at the bottom to open up the newly created folder.

Now when I click on open I should see the left hand nav open up on the Explorer tab.

The Explorer tab is what allows me to view all different files and folders that are inside of my working project directory.

If you do not see the Explorer tab over here. You can always go to View and then click on Explorer right here.

Now inside of this hello world directory,

We are going to create a new file by clicking on the new file button right here.

So we are going to make a new file and call it main dot go

So inside here is where we are going to put a hello world type program.

Again we are going to jsut speed through the code right now.

We are going to throw it all up on the screen.

We are going to take a break and then come back and talk in great detail about each and every line that we are wirting out.

So let us just throw the code up here and then we will talk about what is going on in a moment.

So we will start off by saying package main.

Underneath that will say import ftm and make sure that "fmt" is inside of double quotes, not single quotes we want double quotes here.

And then underneath that will say "fun main",we will put a set of parentheses,

We will put a set of curly braces and inside of there "fmt.println" and make sure that print has a capital P and we will pass it another string of "Hi there" like so.

Now one thing I want to point out to you very important to make sure that you have double quotes both on the import statement right here and on the string that we are passing to the println function.

All right, so now we have put together a very simple and very basic program.

We are going to take a quick break and we are going to come back and we are going to figure out how to run the program and we are going to talk about each and every line code inside here in great great detial.

Quick break, we are going to come back and really dive into this code.

previous page: Cursor installation and GO configuration

next page:

相关推荐
l1t40 分钟前
DeepSeek 4.1总结的Tom Lane 谈塑造 Postgres 三十年历程的架构决策
开发语言·数据库·postgresql·架构
djarmy7 小时前
MAIN.c(1): warning C318: can’t open file ‘STC8G.H’ 报错 解决 分析
c语言·开发语言·mongodb
HEJOO97 小时前
深入理解 Java volatile 关键字:原理、用法与常见误区
java·开发语言·spring
曹牧7 小时前
Java:no content to map due to end of input
java·开发语言
梦梦代码精7 小时前
《回收租赁系统技术选型避坑指南:业务闭环与二开自由度详解》
开发语言·低代码·docker·开源·代码规范
两点王爷7 小时前
SpringBoot 项目集成 GeoServer 源码,实现地图服务发布
java·spring boot·后端
隔窗听雨眠7 小时前
记一次SQL Server数据库性能分析:从CPU100%到单配置修复的完整诊断
开发语言·数据库·php
David猪大卫8 小时前
【C++修炼】智能指针使用及原理
开发语言·c++·经验分享·笔记·学习·考研·面试
charlie1145141918 小时前
现代Qt开发之图像处理进阶:像素操作与格式转换
开发语言·图像处理·qt
李永奉8 小时前
中科蓝讯SDK开发-BT893x 面条耳机连接vivo手机后连接APP端,最后手机端设置页面手动断开蓝牙连接,此时耳机端假断开
c语言·开发语言·嵌入式硬件·物联网·智能手机·电脑