Skip to content
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

Converterの関数名を公式と同じにする #105

Open
1uf3 opened this issue Nov 10, 2023 · 1 comment
Open

Converterの関数名を公式と同じにする #105

1uf3 opened this issue Nov 10, 2023 · 1 comment

Comments

@1uf3
Copy link
Member

1uf3 commented Nov 10, 2023

// authz2ModelMapToPB converts a mapping of domain name to authz2Models into a
// protobuf authorizations map
func authz2ModelMapToPB(m map[string]authz2Model) (*sapb.Authorizations, error) {
    resp := &sapb.Authorizations{}
    for k, v := range m {
        // Make a copy of k because it will be reassigned with each loop.
        kCopy := k
        authzPB, err := modelToAuthzPB(&v)
        if err != nil {
            return nil, err
        }
        resp.Authz = append(resp.Authz, &sapb.Authorizations_MapElement{
            Domain: &kCopy,
            Authz: authzPB,
        })
    }
    return resp, nil
}
@1uf3
Copy link
Member Author

1uf3 commented Nov 10, 2023

あ、上記のコードはforループを使ったバグコードです
使うときは修正してください

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant