Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add go module struct to import the regex definition from external packages#640

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jkroepke wants to merge2 commits intoua-parser:master
base:master
Choose a base branch
Loading
fromjkroepke:embed

Conversation

@jkroepke
Copy link

@jkroepkejkroepke commentedSep 18, 2025
edited
Loading

Because//go:embed does not allow.., it must be defined where the assets are.

The yaml can be used with

importgithub.com/ua-parser/uap_corevaryamlFile=uap_core.RegexDefinitions

@dgoldstein0
Copy link
Contributor

(I'm not a uap-core maintainer, so can't approve this PR). Right now the way this works for uap-go is that we have uap-core as a git submodule and manually run our./build.sh script which updates the submodule & copies the yaml into a .go file in this repo. Is the idea to simplify that somehow?

@jkroepke
Copy link
Author

Yeah. No submodule needed. No build.sh, no source file with inline yaml data. All manual tasks/scripts can be removed in favor of a go native solution.

@dgoldstein0
Copy link
Contributor

Sounds nice. Would that mean users of uap-go could use new uap-core regexes without a uap-go update? That would certainly be nice. (though we've also had the occasional case of newer regexes revealing bugs in uap-go so it's not without risks)

@jkroepke
Copy link
Author

Sounds nice. Would that mean users of uap-go could use new uap-core regexes without a uap-go update?

Yes, uap-core would be a separate Go module with its own lifecycle. Go also supports versionless imports based on Git commit references. Taking it one step further, you could even remove the "default" YAML data from uap-go, making it the end user’s responsibility to choose which version of the data they want to use. That would also be possible while keeping the default YAML, but then the YAML data would be bundled twice (default version + user version), which could unnecessarily bloat the application size.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@jkroepke@dgoldstein0

[8]ページ先頭

©2009-2025 Movatter.jp