Skip to content

svergin/go-dependency-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-dependency-cli

Session 1.1 - Build a VCS client

Build an abstraction package that clones a VCS repo and provides access to the cloned files via fs.FS. The abstraction should basically be a function with a signature like

func GitClone (ctx context.Context, url, branch string) (fs.FS, error)
  • github.com/go-git/go-git will be very helpful to implement the operation
  • go-git uses a billy.Filesystem which does not diretly matches fs.FS. You need to work a way around.
  • You can do the clone "in-memory" or into a temporary directory. What is the performance difference?
  • Write a unit test. You can use https://github.com/halimath/mini-httpd.git (which is very small and fast to clone) and assert that the file LICENSE has a first line with trimmed text equal to "Apache License".

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages