8000 Golang: Hello World by malayparida2000 · Pull Request #2 · Yuggupta27/odf-interns · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Golang: Hello World #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

malayparida2000
Copy link
Contributor
@malayparida2000 malayparida2000 commented Jan 12, 2022

This is my 1st Pull Request. Here I have set up a Golang development environment and executed the first Hello World Program.

import "fmt"

func main() {
fmt.Println("Hello World")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Println("Hello World")
fmt.Println("Hello World")

why fmt.Println?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the Println function of the fmt package , which is similar to the stdio in C. I could have used simple Print or Printf function too. But just that Println adds a new line at the end of the output.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's right but why we would require a new line at the end of output here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually don't. I just gave it as in C++ we mostly add endl to cout as a practice, so did the same here too. Should I change the function to just Print then?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't mix c++ syntax with golang initially it happens but try not to. And always it what the program requires not on the language. Here, we don't want to a new line after Hello World right? So, don't use Println use Print instead.

I know these are small things but we have to think about these too. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it Subham, Will keep it in mind. Making the changes too.

Copy link
Collaborator
@subhamkrai subhamkrai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 2 commits? please squash the commits.
Also, the commit message is empty.

@malayparida2000 malayparida2000 changed the title My First Commit for Hello World Malay Week 1 Jan 18, 2022
@malayparida2000
Copy link
Contributor Author

why 2 commits? please squash the commits. Also, the commit message is empty.

Resolved, Have squashed the 2 commits to 1 clean commit using git rebase

Copy link
Collaborator
@subhamkrai subhamkrai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still PR title needs to change and commit message is empty

@malayparida2000 malayparida2000 changed the title Malay Week 1 Malay-1st PR,Hello World Jan 18, 2022
@malayparida2000 malayparida2000 changed the title Malay-1st PR,Hello World Malay-week 1 PR, Golang Hello World Jan 18, 2022
@malayparida2000 malayparida2000 changed the title Malay-week 1 PR, Golang Hello World Malay-Week 1 PR, Golang Hello World Jan 18, 2022
@malayparida2000 malayparida2000 changed the title Malay-Week 1 PR, Golang Hello World Malay-Week 1 PR, Golang:Hello World Jan 18, 2022
@malayparida2000 malayparida2000 changed the title Malay-Week 1 PR, Golang:Hello World Malay-Week 1 PR, Golang: Hello World Jan 18, 2022
@malayparida2000
Copy link
Contributor Author

still PR title needs to change and commit message is empty
Have changed the PR title to a suitable one and the Commit has a mesage "First Commit for Hello World".

@subhamkrai
Copy link
Collaborator

still PR title needs to change and commit message is empty
Have changed the PR title to a suitable one and the Commit has a message "First Commit for Hello World".

the First Commit for Hello World". is commit tittle not commit message

In this commit I have showed how to print Hello World in Golang using the fmt package
and the Print function.

Signed-off-by: Malay Kumar Parida <mparida@redhat.com>
@malayparida2000
Copy link
Contributor Author

Sorry Subham, Didn't know the difference between title & message. Corrected now. Have addded a message to the commit. Also would be making the same change in week-2 branch's commit.

@subhamkrai subhamkrai changed the title Malay-Week 1 PR, Golang: Hello World Golang: Hello World Jan 19, 2022
@subhamkrai subhamkrai requested a review from Yuggupta27 January 19, 2022 05:18
@Yuggupta27
Copy link
Owner

Signed-off-by: Malay Kumar Parida mparida@redhat.com

Please update the PR description too (can be the same as commit message)

@malayparida2000
Copy link
Contributor Author

Please update the PR description too (can be the same as commit message)

Done Yug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0