You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Fundamentels/identifiers/identifiers.go
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -111,3 +111,32 @@ Output: (after running go run file1.go)
111
111
Hello, World!
112
112
Greetings from file2!
113
113
*/
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:
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`.
0 commit comments