Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9182335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:32:08+00:00 2026-06-17T18:32:08+00:00

I’m trying to compile a Go program made up of multiple modules, like so:

  • 0

I’m trying to compile a Go program made up of multiple modules, like so:

// main.go
package main
import "mst"
// do something interesting involving minimum spanning trees

// src/mst/kruskal.go
import "disjsets"
// Kruskal's algorithm follows

// src/disjsets/disjsets.go
// implements disjoint sets with union-find

Now, when I run either go run main.go or go build after export GOPATH=. in the directory containing both main.go and src, it prints

# disjsets
open src/disjsets/disjsets.go: No such file or directory

I don’t get this. The file is there as ls -l src/disjsets/disjsets.go confirms. How can this happen? Where should the disjsets.go file live if Go is to find it?

(Google Go 1.0.2)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:32:10+00:00Added an answer on June 17, 2026 at 6:32 pm

    I believe you should read, or re-read How to Write Go code

    In short:

    Set you GOPATH to somewhere and export it for good. Then put some package blah into directory

    $GOPATH/src/foo/bar/baz/blah # (1)
    

    or

    $GOPATH/src/blah # (2)
    

    or

    $GOPATH/src/qux/blah # (3) etc.
    

    Import blah into other packages as

    import "foo/bar/baz/blah" // (1)
    

    or

    import "blah" // (2)
    

    or

    import "qux/blah" // (3)
    

    The package in that directory will contain the package files. Say you have only one, blah.go. Then its location would be

    $GOPATH/src/foo/bar/baz/blah/blah.go // (1)
    
    $GOPATH/src/blah/blah.go // (2)
    
    $GOPATH/src/qux/blah/blah.go // (3)
    

    If the blah package source file is named, say proj.go instead, then

    $GOPATH/src/foo/bar/baz/blah/proj.go // (1)
    
    $GOPATH/src/blah/proj.go // (2)
    
    $GOPATH/src/qux/blah/proj.go // (3)
    

    But the import paths would be the same as in the previous case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to render a haml file in a javascript response like so:
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.