Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Finalize generated Go API

オープン
#285 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
go

調査の方向性

Review the proposed Struct, Oneof, Array, and Multimap APIs in the issue body. Compare their behavior for primitive, non-primitive, optional, and dict-enabled values, then document whether the API should be accepted or changed. Done means a clear design decision is recorded; no files or tests are identified in the issue.

索引モデルが issue の本文から書いたものです。

説明

Go

The API currently looks like this:

Struct
// Return value of “Field” of primitive type
S.Field() <type>

// Return pointer to “Field” of non-primitive type
// For dict-enabled types returned value is readonly.
S.Field() *<type>

// Set value of “Field” of primitive type
// For optional fields also sets the presence flag
S.SetField(val <type>)

// Set value of “Field” of dict-enabled non-primitive type
// For optional fields also sets the presence flag
S.SetField(val *<type>)

// Check if an optional “Field” is present
S.HasField() bool

// Unset presence flag for an optional “Field”
S.UnsetField()
Oneof
// Return the type of the current choice in oneof
S.Type() <int-type>

// Return value of primitive type, assuming the current choice
// of oneof is “Field”.
S.Field() <type>

// Return pointer to non-primitive type, assuming the current choice
// of oneof is “Field”.
// For dict-enabled types returned value is readonly.
S.Field() *<type>

// Set value of primitive type. Sets the choice of oneof to “Field”
// For optional fields also sets the presence flag
S.SetField(val <type>)

// Set value of dict-enabled non-primitive type by pointer.
// Sets the choice of oneof to “Field”
S.SetField(val *<type>)
Array
// Return number of elements
A.Len()

// Return element at index i (primitive type).
// Panics if index is out of range.
A.At(i int) <type>

// Set element at index i (primitive type)
// Panics if index is out of range.
A.SetAt(i int, val <type>)

// Return element at index i (non-primitive type)
// Panics if index is out of range.
// For dict-enabled types returned value is readonly.
A.At(i) *<type>

// Set element at index i (dict-enabled, non-primitive type)
// Panics if index is out of range.
A.SetAt(i int, val *<type>)

// Set length of the array. If array length grows, new elements
// are appended at the end in a zero-initialized state.
// For non-primitive types subsequent At() for new elements returns non-nil pointer.
A.EnsureLen(len int)
Multimap
// Return number of key-value pairs
M.Len()

// Return key-value pair at index i
M.At(i int) *<KeyValueType>

// Return key of the pair. Returns a pointer for non-primitive types.
<KeyValueType>.Key() <type>

// Return value of the pair. Returns a pointer for non-primitive types.
<KeyValueType>.Value() <type>

// Set the key of the pair (primitive type)
<KeyValueType>.SetKey(key <type>)

// Set the key of the pair (dict-enabled non-primitive type).
<KeyValueType>.SetKey(key *<type>)

// Set the value of the pair (primitive type)
<KeyValueType>.SetValue(key <type>)

// Set the value of the pair (dict-enabled non-primitive type).
<KeyValueType>.SetValue(key *<type>)

// Set length of the multimap. If the length grows, new key-value pairs
// are appended at the end in a zero-initialized state.
// For non-primitive types subsequent At() for new key-value pairs return
// non-nil pointer.
M.EnsureLen(len int)

We want to review and decide if this is the desirable API or we want to change it.

主要言語
Java
スター
11
フォーク
6
平均マージ
55分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

splunk/stef のほかの issue

splunk/stef の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。