0

Looking for hints about how to direct my research. I have a Go application that takes a directory in the form of the io package's fs.FS as its input. However the directory it needs is actually stored in a remote git repo (Github or Gitlab).

I'm trying to figure out how to convert the git repo address and directory path into a fs.FS that I can feed my application. I have just come across the go-git package and that looks promising. Intuitively though, it seems like a git clone would be pulling way too much info if I want only one directory, and I know the branch name (main) I'm interested in.

I'd appreciate pointers on how to do this, even at a high level.

BeetleJuice
  • 39,516
  • 19
  • 105
  • 165
  • A repository is a collection of commits (not files); an `fs.FS` is a collection of files as a tree, i.e., one tree from one commit. So there's an impedance mismatch here: which commit(s) did you want in your `fs.FS` instance? – torek Nov 21 '22 at 21:50

0 Answers0