Skip to content

fixed README example and adjusted underlying implementation accordingly#147

Merged
NGTmeaty merged 2 commits into
internetarchive:masterfrom
Ahmed-Armaan:README_example_fix
Oct 2, 2025
Merged

fixed README example and adjusted underlying implementation accordingly#147
NGTmeaty merged 2 commits into
internetarchive:masterfrom
Ahmed-Armaan:README_example_fix

Conversation

@Ahmed-Armaan

Copy link
Copy Markdown
Contributor

fixes #146: Issues with Example Usage in README

Description

This PR addresses several issues identified in the example usage provided in the README.

Fixes

1. ErrChan access

  • Corrected access to ErrChan from the proper struct field.
  • Previously, the example attempted to access client.Client.ErrChan, which does not exist.

2. Compression setting causes panic

  • Normalized compression type input to lowercase before validation.
  • This prevents panics when "gzip" or "zstd" are provided in lowercase.
  • Ensures the example works as written while maintaining compatibility with existing logic.

3. Missing imports

  • Added missing imports (io, fmt, context) to the README example.

@CorentinB CorentinB requested a review from Copilot October 1, 2025 09:20
@CorentinB CorentinB added the enhancement New feature or request label Oct 1, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issues in the README example code and adjusts the underlying implementation to support case-insensitive compression type handling. The changes ensure that the README example works correctly without panics and that compression types can be specified in lowercase.

  • Fixed README example to access the correct ErrChan field and include missing imports
  • Modified compression validation to be case-insensitive by converting input to lowercase
  • Corrected variable assignment in the README example

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
utils.go Updated compression validation to accept lowercase compression types and handle case-insensitive comparison
README.md Fixed ErrChan access, added missing imports, and corrected variable assignment

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread utils.go Outdated
@Ahmed-Armaan

Copy link
Copy Markdown
Contributor Author

hey @CorentinB , can you review the latest changes

@NGTmeaty NGTmeaty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you for the PR!

@NGTmeaty NGTmeaty merged commit 401e95d into internetarchive:master Oct 2, 2025
1 check passed
@Ahmed-Armaan Ahmed-Armaan deleted the README_example_fix branch October 2, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with Example Usage in README

4 participants