Repository navigation
An otlp file of one request ends in .json, and tfg formats names each ending #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
dbda200
An otlp file of one request ends in .json, and tfg formats names each…
donislawdev 7d87c20
build(deps): bump github.com/nicksnyder/go-i18n/v2 from 2.6.1 to 2.7.0
donislawdev bf2376b
tfg formats is held to the endings a setting gives, in its text and i…
donislawdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package format | ||
|
|
||
| import ( | ||
| "maps" | ||
| "slices" | ||
| ) | ||
|
|
||
| // ExtensionFor is what the name of a file of this format ends in when it is | ||
| // made with props: the ending the chosen value of a setting names, and | ||
| // Extension when none does. | ||
| // | ||
| // A setting that is absent or empty counts at its default, the way every | ||
| // generator reads it, and a default never names an ending of its own - so that | ||
| // is Extension too. The value is compared as it is spelled, as Allows compares | ||
| // it, so the value the engine accepted is the value looked up here. | ||
| // | ||
| // The engine asks once for each target rather than once for each file: the | ||
| // settings belong to the target, and a target can be a million files. | ||
| func (d Descriptor) ExtensionFor(props map[string]string) string { | ||
| for _, p := range d.Properties { | ||
| if ext, named := p.Extensions[props[p.Name]]; named { | ||
| return ext | ||
| } | ||
| } | ||
| return d.Extension | ||
| } | ||
|
|
||
| // Extensions is every ending a file of this format can have: Extension first, | ||
| // then each one a setting can give instead, in order and once each. It is for | ||
| // a surface that lists formats, and has no settings in hand to ask ExtensionFor | ||
| // with. | ||
| func (d Descriptor) Extensions() []string { | ||
| others := map[string]bool{} | ||
| for _, p := range d.Properties { | ||
| for _, ext := range p.Extensions { | ||
| others[ext] = true | ||
| } | ||
| } | ||
| delete(others, d.Extension) | ||
| return append([]string{d.Extension}, slices.Sorted(maps.Keys(others))...) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.