From 61f928136c3e3223141a4be2183862b71214efba Mon Sep 17 00:00:00 2001 From: Ron Evans Date: Mon, 19 Nov 2018 20:20:24 +0100 Subject: [PATCH] all: use New() constructor function for simplicity Signed-off-by: Ron Evans --- mag3110/mag3110.go | 4 ++-- mma8653/mma8653.go | 4 ++-- mpu6050/mpu6050.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mag3110/mag3110.go b/mag3110/mag3110.go index 47133a9..5c5bc1d 100644 --- a/mag3110/mag3110.go +++ b/mag3110/mag3110.go @@ -13,11 +13,11 @@ type Device struct { bus machine.I2C } -// NewI2C creates a new MAG3110 connection. The I2C bus must already be +// New creates a new MAG3110 connection. The I2C bus must already be // configured. // // This function only creates the Device object, it does not touch the device. -func NewI2C(bus machine.I2C) Device { +func New(bus machine.I2C) Device { return Device{bus} } diff --git a/mma8653/mma8653.go b/mma8653/mma8653.go index 8ab2080..96b6d3d 100644 --- a/mma8653/mma8653.go +++ b/mma8653/mma8653.go @@ -14,11 +14,11 @@ type Device struct { bus machine.I2C } -// NewI2C creates a new MMA8653 connection. The I2C bus must already be +// New creates a new MMA8653 connection. The I2C bus must already be // configured. // // This function only creates the Device object, it does not touch the device. -func NewI2C(bus machine.I2C) Device { +func New(bus machine.I2C) Device { return Device{bus} } diff --git a/mpu6050/mpu6050.go b/mpu6050/mpu6050.go index 937c86f..2845c42 100644 --- a/mpu6050/mpu6050.go +++ b/mpu6050/mpu6050.go @@ -15,11 +15,11 @@ type Device struct { bus machine.I2C } -// NewI2C creates a new MPU6050 connection. The I2C bus must already be +// New creates a new MPU6050 connection. The I2C bus must already be // configured. // // This function only creates the Device object, it does not touch the device. -func NewI2C(bus machine.I2C) Device { +func New(bus machine.I2C) Device { return Device{bus} }