From 8c807d1289de32b1a52a42893b7994b14fd29288 Mon Sep 17 00:00:00 2001 From: Stani Date: Tue, 7 Jul 2015 23:35:03 +0200 Subject: [PATCH] make sample interface private --- draw2dpdf/test_test.go | 6 ++++-- gc.go | 2 -- test_test.go | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/draw2dpdf/test_test.go b/draw2dpdf/test_test.go index 923f021..a763c59 100644 --- a/draw2dpdf/test_test.go +++ b/draw2dpdf/test_test.go @@ -11,12 +11,14 @@ import ( "github.com/llgcode/draw2d/draw2dpdf" ) -func test(t *testing.T, sample draw2d.Sample) { +type sample func(gc draw2d.GraphicContext, ext string) (string, error) + +func test(t *testing.T, draw sample) { // Initialize the graphic context on an pdf document dest := draw2dpdf.NewPdf("L", "mm", "A4") gc := draw2dpdf.NewGraphicContext(dest) // Draw sample - fn, err := sample(gc, "pdf") + fn, err := draw(gc, "pdf") if err != nil { t.Errorf("Drawing %q failed: %v", fn, err) return diff --git a/gc.go b/gc.go index 8248cdc..66dc508 100644 --- a/gc.go +++ b/gc.go @@ -15,8 +15,6 @@ const ( FillRuleWinding ) -type Sample func(gc GraphicContext, ext string) (string, error) - type GraphicContext interface { Path // Create a new path diff --git a/test_test.go b/test_test.go index 33cbfac..ca58f79 100644 --- a/test_test.go +++ b/test_test.go @@ -9,7 +9,9 @@ import ( "github.com/llgcode/draw2d" ) -func test(t *testing.T, draw draw2d.Sample) { +type sample func(gc draw2d.GraphicContext, ext string) (string, error) + +func test(t *testing.T, draw sample) { // Initialize the graphic context on an RGBA image dest := image.NewRGBA(image.Rect(0, 0, 297, 210.0)) gc := draw2d.NewGraphicContext(dest)