Giter Club home page Giter Club logo

Comments (3)

wdreeveii avatar wdreeveii commented on June 8, 2024

We are willing to accept small/isolated pull requests to fix issues like
these. :)

On Sun, Jul 10, 2016 at 9:20 PM, Patrick Hemmer [email protected]
wrote:

The code has several places where a struct has a method which takes
arguments that are also struct members.

For example:
https://github.com/soniah/gosnmp/blob/f6904fd235070fe56e2c2d799ac5f5862fc32543/marshal.go#L253

packetOut.marshalMsg(pdus, packetOut.PDUType, msgID, reqID)

The obvious one is packetOut.PDUType. The marshalMsg method already has
access to packetOut.PDUType because they are both members of the same
struct (SnmpPacket).
However all the others can be removed as well.

  • pdus - SnmpPacket has a Variables member which should be used
    instead.
  • msgID - SnmpPacket has a MsgID member
  • reqID - SnmpPacket has a RequestID member

Numerous other methods are used the same way:

  • marshalSnmpV3ScopedPDU
  • prepareSnmpV3ScopedPDU
  • marshalPDU
  • marshalVBL

Another example, (*GoSNMP).GetBulk(oids []string, nonRepeaters uint8,
maxRepetitions uint8).
The GoSNMP struct has NonRepeaters and MaxRepetitions members. Why, if
we're not going to use them?

Aside from not being proper go, these make the code very confusing to
follow. And in that last case, confusing to use.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#71, or mute the thread
https://github.com/notifications/unsubscribe/AApLwad8CtsCSW9xQuK_vggnQAxCsHioks5qUdKwgaJpZM4JJChO
.

Whitham D. Reeve II
907-764-5263

from gosnmp.

soniah avatar soniah commented on June 8, 2024

Hi Patrick @phemmer thanks for your great suggestions. Would you be able to have a go at this? It seems a smaller task than #70 :-)

from gosnmp.

wdreeveii avatar wdreeveii commented on June 8, 2024

Many instances of this has been fixed. If you see others please let us know.

from gosnmp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.