Skip to content

Commit

Permalink
fix: don't forget to seek file after writing
Browse files Browse the repository at this point in the history
  • Loading branch information
savely-krasovsky committed Jun 29, 2023
1 parent 326ea6f commit 30d38de
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions geosite_antizapret/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func (g *Generator) GenerateAndUpload(ctx context.Context) error {
return fmt.Errorf("cannot generate: %w", err)
}

if _, err := geositeFile.Seek(0, io.SeekStart); err != nil {
return fmt.Errorf("failed to seek: %w", err)
}

geositeFileHashSumFile, err := os.CreateTemp("", "geosite_antizapret")
if err != nil {
return fmt.Errorf("cannot create temp file: %w", err)
Expand All @@ -154,6 +158,10 @@ func (g *Generator) GenerateAndUpload(ctx context.Context) error {
return err
}

if _, err := geositeFileHashSumFile.Seek(0, io.SeekStart); err != nil {
return fmt.Errorf("failed to seek: %w", err)
}

tagName := time.Now().Format("20060102150405")
repositoryRelease, _, err := g.githubClient.Repositories.CreateRelease(ctx, g.githubOwner, g.githubRepo, &github.RepositoryRelease{
TagName: &tagName,
Expand Down

0 comments on commit 30d38de

Please sign in to comment.