Can different custom packages for key and value is possible?
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 領域
- tooling
調査の方向性
syncmap のコードジェネレーターを見て、現在 types と imports をどのように扱っているかを理解してください。この issue は、keys と values に対して異なる packages の custom types をサポートすることに関するものです。まず map type string の parsing と import 管理を調べてください。custom types に対する既存の tests があるか確認してください。目標は、必要な imports を追加し、circular dependencies を引き起こさずに packages をまたいだ type references を処理するように generator を変更することです。
索引モデルが issue の本文から書いたものです。
説明
Hi @a8m ,
Currently using a basic
syncmap -name UserChannelsMap -pkg xmap -o ./types/xmap/user_channels_map.go "map[string]string"
will work.
If I want to use a custom type:
syncmap -name UserChannelsMap -pkg xmap -o ./types/xmap/user_channels_map.go "map[string]*UserChannelList"
I need to make sure UserChannelList is in the same package than the one exported for the file (here xmap). I could arrange myself to do so, but it brings some complexity.
Last case, I want to use like an "enum" for the keys, in my case it's defined in my own constant package, how could I deal with this? From what I understand it's not possible, the syncmap would have to manage some add of imports, no?
syncmap -name UserChannelsMap -pkg xmap -o ./types/xmap/user_channels_map.go "map[constant.NameID]*UserChannelList"
Maybe I missed something 🤔
Thank you,
EDIT: a workaround could be that aside my exported file (having package xmap) I could declare type aliases for both the key and the value types, like:
import ...
type NameID = constant.NameID
type UserChannelList = entity.UserChannelList
EDIT2: in all cases, I should make sure it won't bring circular loop if the XXXMap was needed in one of those packages ^^
- 主要言語
- Go
- スター
- 257
- フォーク
- 17
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
a8m/syncmap のほかの issue
-
Fails with errorオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 40/100
-
GetValues & GetKeysオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
似ている issue
-
docs(prompt): filer socket fragment hardcodes an issue-intent cap of 8 that Chore runs overrideオープンagent-butler-finding chore
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jordansmall/spindrift#5128 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 2 日以内に返信
-
License GOtome under Apache 2.0 instead of AGPL-3.0対応中かも @praetorianer777 が今日担当しました。 オープンarea:workflow documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
praetorianer777/GoTome#212 ·
メンテナーはふだん 1 日以内に返信
-
ci: pin Go version in Build and Unit Test workflows (>=1.26.6 floats to 1.27.2 and breaks golangci-lint)対応中かも @leninmehedy が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
hashgraph/solo-weaver#1255 ·
メンテナーはふだん 1 日以内に返信
-
area/infra backlog type/chore
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
praetorianer777/Stator#374 ·
メンテナーはふだん 1 日以内に返信