Skip to content

Instantly share code, notes, and snippets.

@thrawn01
Created April 20, 2023 01:32
Show Gist options
  • Save thrawn01/4ead86f5ed2c51d02da687bbc497a209 to your computer and use it in GitHub Desktop.
Save thrawn01/4ead86f5ed2c51d02da687bbc497a209 to your computer and use it in GitHub Desktop.
The code I gave ChatGPT
type Job struct {
Id int
FileName string
FSType string
Status string
}
type Store1 interface {
GetBatchID() int
}
type Store2 interface {
CreateBatchJob(Job) error
}
type Service struct {
s1 Store1
s2 Store2
}
type FileSystem interface {
ReadFile(name string) (io.ReadCloser, error)
WriteFile(name string) (io.WriteCloser, error)
FSType() string
}
func (s *Service) UploadAndEnqueueJob(appID int, src io.ReadCloser, dest FileSystem) error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment