Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.
This repository was archived by the owner on May 14, 2025. It is now read-only.

expose fields of structure to aid in unit testing #145

@AmitKumarDas

Description

@AmitKumarDas

Take for example following structure used in dynamic/clientset/clientset.go file

type Clientset struct {
  config           rest.Config
  discoveryManager *dynamicdiscovery.APIResourceDiscovery
  dynamicClient    dynamic.Interface
}

Above structure does not provide any solution for the packages that depend on above struct during this package' unit tests. It will be easier to test if these fields were public.
Alternate way will be to expose an interface for each & every public method of this struct. However, it does not seem the most idiomatic way to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions