4kux / winsvc

Automatically exported from code.google.com/p/winsvc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Typo in name of svc.IsAnInteractiveSession #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The function svc.IsAnIinteractiveSession (note the extra "i") should be 
svc.IsAnInteractiveSession. Diff:

diff -r 187091ca1db6 svc/security.go
--- a/svc/security.go   Sat Jul 21 20:41:30 2012 +1000
+++ b/svc/security.go   Wed Oct 02 14:01:59 2013 -0700
@@ -50,10 +50,10 @@
    return sid, nil
 }

-// IsAnIinteractiveSession determines if calling process is running 
interactively.
+// IsAnInteractiveSession determines if calling process is running 
interactively.
 // It queries the process token for membership in the Interactive group.
 // http://stackoverflow.com/questions/2668851/how-do-i-detect-that-my-application-is-running-as-service-or-in-an-interactive-s
-func IsAnIinteractiveSession() (bool, error) {
+func IsAnInteractiveSession() (bool, error) {
    interSid, err := allocSid(winapi.SECURITY_INTERACTIVE_RID)
    if err != nil {
        return false, err

Original issue reported on code.google.com by mi...@classroomsystems.com on 2 Oct 2013 at 9:03

GoogleCodeExporter commented 8 years ago
Oh, the spelling also has to be changed in example/main.go.

Original comment by mi...@classroomsystems.com on 2 Oct 2013 at 9:13

GoogleCodeExporter commented 8 years ago
You should have told me long time ago :-). I don't want to break other people's 
code. Here are couple of ways to fix it:

1) do nothing;
2) rename IsAnIinteractiveSession function to IsAnInteractiveSession;
3) add new IsAnInteractiveSession function that just calls 
IsAnIinteractiveSession under covers.

Which one you prefer? Why? Did I miss any other alternatives?

Thank you.

Alex

Original comment by alex.bra...@gmail.com on 3 Oct 2013 at 7:35

GoogleCodeExporter commented 8 years ago
I hate leaving the misspelling alone simply because it's so easy to miss 
visually. It took me a minute to figure out why my code didn't compile using 
the correctly-spelled name. I favor option 3 (support both spellings), probably 
with a note in godoc saying that the misspelled version is just for API 
compatibility. Maybe the misspelled name could be removed if and when there's a 
Go 2.

Original comment by mi...@classroomsystems.com on 3 Oct 2013 at 5:37

GoogleCodeExporter commented 8 years ago
Please, review https://codereview.appspot.com/14198044/. Thank you.

Alex

Original comment by alex.bra...@gmail.com on 3 Oct 2013 at 11:50

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 0dd894180583.

Original comment by alex.bra...@gmail.com on 4 Oct 2013 at 2:05