Skip to content

Commit ba1b074

Browse files
committed
import changes
1 parent b849341 commit ba1b074

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

Fundamentels/identifiers/file1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"fmt"
5-
"github.com/Shikha-code36/golang-tutorial-practice/Fundamentels/identifiers/file2/file2.go"
5+
"github.com/Shikha-code36/golang-tutorial-practice/Fundamentels/identifiers/file2"
66
)
77

88
// Exported variable

Fundamentels/identifiers/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/Shikha-code36/golang-tutorial-practice/Fundamentels/identifiers/file2.go
1+
module github.com/Shikha-code36/golang-tutorial-practice/Fundamentels/identifiers/file2
22

33
go 1.22.2

Fundamentels/identifiers/identifiers.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,32 @@ Output: (after running go run file1.go)
111111
Hello, World!
112112
Greetings from file2!
113113
*/
114+
115+
116+
/*
117+
118+
1. **Ensure Correct Directory Structure**: Make sure `file2.go` is inside a directory named `file2` under `identifiers`. The structure should look like this:
119+
120+
```
121+
identifiers/
122+
├── file1.go
123+
└── file2/
124+
└── file2.go
125+
```
126+
127+
2. **Correct Import Statement**: In `file1.go`, the import statement should be:
128+
129+
```go
130+
import (
131+
"fmt"
132+
"github.com/Shikha-code36/golang-tutorial-practice/Fundamentels/identifiers/file2"
133+
)
134+
```
135+
136+
3. **Initialize Go Module at Root**: Navigate to the root of your project (where `identifiers` directory is located) and run `go mod init github.com/Shikha-code36/golang-tutorial-practice`.
137+
138+
4. **Run `go mod tidy`**: This command will add missing and remove unused modules.
139+
140+
5. **Run Your Go File**: Now, navigate back to the `identifiers` directory and you should be able to run your Go file with `go run file1.go`.
141+
142+
*/

0 commit comments

Comments
 (0)