Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Golang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad, Hammad
Golang
Commits
24342ee0
Commit
24342ee0
authored
Mar 03, 2023
by
Muhammad, Hammad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
read file data
parent
25222367
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
input_file.txt
input_file.txt
+1
-0
main.go
main.go
+21
-2
No files found.
input_file.txt
0 → 100644
View file @
24342ee0
Hello World !!! From the file
\ No newline at end of file
main.go
View file @
24342ee0
package
main
package
main
import
"fmt"
import
(
"bufio"
"fmt"
"os"
)
func
main
()
{
func
main
()
{
fmt
.
Println
(
"Hello World !!!"
)
fileName
:=
os
.
Args
[
1
]
f
,
err
:=
os
.
Open
(
fileName
)
if
err
!=
nil
{
fmt
.
Println
(
"Error : "
,
err
)
os
.
Exit
(
1
)
}
defer
f
.
Close
()
scanner
:=
bufio
.
NewScanner
(
f
)
for
scanner
.
Scan
()
{
fmt
.
Println
(
scanner
.
Text
())
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment