printsome

package
v0.0.0-...-9882766 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package printsome for testing package interface boundary. The whole purpose if this program is to limit what variables and methods gets exported out of the package. Since the printerType is not exported its methods will not be exported either, but we will now export them via the new APrinter interface.

We then create an interface containing printerType's methods. The interface APrinter is exported, and will be available outside the package. Since we use the New() function which returns a not exported printerType via the APrinter interface type, we are able to export a private type via the exported interface type. All methods belonging to the interface type APrinter will be availabe to the new variable create in main.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APrinter

type APrinter interface {
	PrintA()
	PrintB()
}

APrinter is an interface to do some testing

func New

func New() APrinter

New creates a new printerType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL