oras-project / oras-go

ORAS Go library
https://oras.land
Apache License 2.0
172 stars 94 forks source link

doc: add example for digest and parseReference #670

Closed sajayantony closed 8 months ago

sajayantony commented 8 months ago

Using this PR to discuss the need for importing the hash algorithm. One option is that add this to the examples for digest or parse reference or it possible to have indirect dependencies. I'm leaning towards not having an indirect dependency since this means that if and when a algorithm becomes unacceptable the library has to rev. Instead clients taking the appropriate imports could define the actual hash algorithms that are being used - https://cloud-native.slack.com/archives/CJ1KHJM5Z/p1704365828594969

On a side note, how what would be a good pattern to exclude full file examples from license header check?

Related to - https://github.com/oras-project/oras-go/pull/671

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (0b78aa6) 75.46% compared to head (fa2b729) 75.46%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #670 +/- ## ======================================= Coverage 75.46% 75.46% ======================================= Files 59 59 Lines 5640 5640 ======================================= Hits 4256 4256 Misses 1019 1019 Partials 365 365 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

shizhMSFT commented 8 months ago

On a side note, how what would be a good pattern to exclude full file examples from license header check?

Don't worry about the license headers. You can just add them in the source file and they will be ignored by godoc generation. Examples can be found at:

shizhMSFT commented 8 months ago

Closing this PR as it is succeeded by #675 and whole file example can be found on godoc.